in reply to dos file masks and regular expressions
DOS wildcards only know 2 meta symbols: * and ?.
In regex speak these would be written as .* and . respectively *)
All other characters have to be taken literally.
Update: depending on how close you want to come to the results of DOS's "dir" you need additional restrictions, like surrounding the expression with begin and end assertions as in: $re = '^help.*\.txt$';
Update: *) ? is exactly 1 character (not "one or none" as my previous .? described.
Thanks to riceWind for spotting my error.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: dos file masks and regular expressions
by rinceWind (Monsignor) on Jan 04, 2006 at 12:24 UTC | |
|
Re^2: dos file masks and regular expressions
by fluffyvoidwarrior (Monk) on Jan 04, 2006 at 12:10 UTC |