Now that code tags have been added to your node so that the code is clear, the problem also is clear. You are using [] in the regex which means match any of the characters within the square brackets. The fix is almost easy - use a non-capture group ((?:...)):
if ($filename =~ /(\.(?:htm|html|txt|pdf|ppt|csv|doc]))\b/i)
Note that the repeat ({3,4}) is not needed.
In reply to Re: perl regular expression
by GrandFather
in thread perl regular expression
by arunmep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |