I've cut out the source of the actual data, and inserted sample info for simplicity. How is my improvement?#!perl -w @res='index.cgi'; @ext=qw(css tmp class edf); @regex=''; foreach(@ext){ $reg=$reg."|^.*\\.$_\$"; } foreach(@res){ $reg=$reg."|^\Q$_\E\$"; } if($regex){ $reg="|$regex$reg"; } $thing=~/^\.+$$reg/i;
In reply to Re: Re: Capitalization and Regex
by pekkhum
in thread Capitalization and Regex
by pekkhum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |