The documentation at http://h71000.www7.hp.com/doc/731final/documentation/pdf/ovms_731_file_app.pdf (section 5-1) says the filename should look like this:
node::device:[root.][directory-name]filename.type;version
Most of them are optional (like node, device, version) - not sure which ones and how to correctly write this in a regexp, (including the directory name):
DISK1:[MYROOT.][MYDIR]FILE.DAT
DISK1:[MYDIR]FILE.DAT
[MYDIR]FILE.DAT
FILE.DAT;10
NODE::DISK5:[REMOTE.ACCESS]FILE.DAT
See the documentation and source for the VMS::Filespec Perl module.
You could probably come up with a single complicated regex for this, but it will be much easier to read your code if you work your way from left to right stripping off each section if it is there. The following is some Python code that does just that:
and the output is
From wikipedia, the full form is actually a bit more than that:
This one took a while, but here is an expression that should accept all valid variations, and place the components into capture groups.
Also, from what I can tell, your example of
is not a valid name. I believe only one pair of brackets are allowed. I hope this helps!