I\'m trying to write a very simple regular expression that matches any file name that doesn\'t end in .php. I came up with the following...
(.*?)(?!\\.php)$
Almost:
.*(?!\.php)....$
The last four dots make sure that there is something to look ahead at, when the look-ahead is checked.
The outer parentheses are unnecessary since you are interested in the entire match.
The reluctant .*?
is unnecessary, since backtracking four steps is more efficient than checking the following condition with every step.