in reply to Re: matching file names using regex
in thread matching file names using regex
The negative aspect of using two regex to check legality is that it's a bit harder to supply a rule in a configuration file, such as those used by spam filters, etc. If your code can't handle two supplied regex, then you'll have to figure out one.
A negative look-behind is useful.
print if m{ ^ # begins with test # 'test' \d+ # a number .*? # nothing or anything else (?<! ~ ) # but no '~' at the tail $ # to the end }ix;
--
[ e d @ h a l l e y . c c ]
|
|---|