See my node Building Regex Alternations Dynamically for a short tutorial on this. Also, I see you're using glob, be aware that it has several caveats, for example in this case if $dir happens to have any whitespace or glob metacharacters in it, it will not do what you want. I mention several alternatives in that link.
In reply to Re: Match similar words in file name
by haukex
in thread Match similar words in file name
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |