A
AAaron123
I know this isn't a regular expression NG but there does not appear to be
one in the microsoft series which is all my news reader shows.
I need a test to see that a string is a valid path to a file.
The string does not have a drivename nor a filename, simply a collection of
folder names, but I could add that for the test.
I don't know anything about regular expressions so I looked on the Internet
and found some.
The following two are quite different in length.
I'm hoping someone with a little experience can help me select one or maybe
share the one they use.
One other question: Can I use any regular expression or must it be one
directed to visual studio languages. That is, is there more than one
specification for writing regular expressions?
Thanks in advance
//Matches filenames
//^([a-zA-Z]\
(\\[^\\/:*?<>"|]*(?<![ ]))*(\.[a-zA-Z]{2,6})$
//Matches drives, folders and file on a Windows OS. Folder matches must end
with \ Folder and file names can not end with a space. I limited the file
extension length to 15 though that not a restriction of a file's extension
This is a mod of Darren's regex
http://www.regexlib.com/REDetails.aspx?regexp_id=357 and my own
http://www.regexlib.com/REDetails.aspx?regexp_id=137 Updated Feb 2005
//^((?:[a-zA-Z]
|(?:\\{2}\w[-\w]*)\$?)\\(?!\.)((?
?![\\/:*?<>"|])(?)[\x20-\x7E])+\\(?!\.))*((?
?
?![\\/:*?<>"|])(?![
..]$)[\x20-\x7E])+)\.((?
?![\\/:*?<>"|])(?![ .]$)[\x20-\x7E]){2,15}))?$
one in the microsoft series which is all my news reader shows.
I need a test to see that a string is a valid path to a file.
The string does not have a drivename nor a filename, simply a collection of
folder names, but I could add that for the test.
I don't know anything about regular expressions so I looked on the Internet
and found some.
The following two are quite different in length.
I'm hoping someone with a little experience can help me select one or maybe
share the one they use.
One other question: Can I use any regular expression or must it be one
directed to visual studio languages. That is, is there more than one
specification for writing regular expressions?
Thanks in advance
//Matches filenames
//^([a-zA-Z]\

//Matches drives, folders and file on a Windows OS. Folder matches must end
with \ Folder and file names can not end with a space. I limited the file
extension length to 15 though that not a restriction of a file's extension
This is a mod of Darren's regex
http://www.regexlib.com/REDetails.aspx?regexp_id=357 and my own
http://www.regexlib.com/REDetails.aspx?regexp_id=137 Updated Feb 2005
//^((?:[a-zA-Z]




..]$)[\x20-\x7E])+)\.((?
