
On Wed, 12 Apr 2006 16:30:26 -0600, Lynn Allan wrote:
Homework? What have you tried .... with what results?
Jean-Sebastien Vachon wrote:
Hi there,
I am sure what I am looking for exist somewhere but I haven't been able to find anything that works in boost::regex.
What I am looking for is a regular expression that will validate a filename according to the specification of the OS (UNIX systems and Windows).
I would be very grateful if someone could provide me with these two expressions (one for Linux and one for Windows).
Later,
Hi, So far the best expression I have for Windows is: (((((^([a-z]:\\?)|(^\\\\[^\\;:\'\"<>]+\\[^\\]+\\)))))(((([^\\;:\'\"\<\>]+)\\)*)*)((([^\\;:\'\"<>]*))(\.?([^\\:;\'\"<>]+)))?) I used Visual RegExp 3.0 to test and debug my expression(s). It is a very nice tool. The For UNIX I am currently using: ((/([^/]+)?)*)(([^/.]*).?([^/])*) I haven't tested it completely but it seems to do the job. If you spot any potential problem please let me know. Later,