Perl Regex - Year but no but.

I needed recently to select a list of filename that ended in .php, .php4 or .php5 except for those in a particular directory and I wanted to do it in one clean regular expression. It took me some time but in the end this is the solution that I came up with.

   ^(?(/phpokayhere/)^|.*\.php[45]*$)

 My first reaction was to try a lookbehind assertion where you would say the following

   (?

516 views and 0 responses