* represent anything
? represent a character
like dos filename
*.test.com will match aaa.test.com but not match test.com
a dos like regexp *.test.com is similar with regexp /.*\.test\.com/ in php
is there a builtin function to test dos-like regexp in php?
As far as I can see in your case
glob()and/orfnmatch()will do it.Note, that this are not regular expressions, because this is just a much more simple pattern matching. I don’t see a reason, why you should use regex here, thus at least
fnmatch()should do it more efficient.