in reply to Re: perl regular expression
in thread perl regular expression
The following wont print match...
... however swap in the this one, and is passes just fine...my $filename = "/home/root/this_is_a_valid_name.html.gz"; if ($filename =~ m/(\.(htm|html|txt|pdf|ppt|csv|doc))$/i) { print "match\n"; # this won't print }
my $filename = "/home/root/this_is_a_valid_name.html.gz"; if ($filename =~ /(\.(?:htm|html|txt|pdf|ppt|csv|doc]))\b/i) { print "match\n"; # this will print }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: perl regular expression
by chargrill (Parson) on Oct 03, 2006 at 18:15 UTC |