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)$
You are at the end of the string and looking ahead. What you want is a look behind instead:
(.*)$(?
Note that not all regular expression engines support lookbehind assertions.