## # This isn't part of the core logic: we're just trying to make regexp # generation easy for admins with weak regex chops # The original use case used regexps to select files of interest. my @name_patterns = qw { *.conf$ ^ho ^net }; my @name_regexps = map { s/\./\\./g; s/\*/(\.+)?/g; qr {$_}; } @name_patterns;
The * glob pattern can match zero characters but you are replacing it with (\.+)? which has to match at least one character. Perhaps you want to use this instead: s/\*/(?s:.*?)/g; And don't forget the ? glob pattern which must match one character: s/\?/(?s:.)/g;
In reply to Re: File finder
by jwkrahn
in thread File finder
by mpeever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |