That’s fine with the exception of the red bits in the code. However, as ScallioXTX points out, [.php]+ is trying to match, IN ANY ORDER, dot characters, p’s, h’s and p’s AGAIN!
Remon,
Ah, but it will! (1) You NEVER escape the dot character in a range definition as it’s NOT a metacharacter there, it IS a dot character. The problem, as discussed above, is that the enclosed characters can appear in any order and as often as they like (one or more) with the + metacharacter modifying the range definition.
Eh, I’m not fond of wildcards like that (they’re even more difficult for newbies to learn how to use properly - as you’ll see next) and the \w is only for word characters so it won’t match the _'s t3 was after.
It won’t work, because you haven’t escaped the dot. Also, [.php] does not really make sense, since it defining a regex class, and does not say php has to in that order p - h - p.
Instead you should use: