Author Topic: Perl regular expression help  (Read 1498 times)

0 Members and 1 Guest are viewing this topic.

Offline Fury

  • The Curmudgeon
  • 213
Perl regular expression help
I have this one config file where I need to use perl regular expressions, preferably the lookahead assertion.

A normal include syntax would be like this:
Code: [Select]
"\.(php|cgi|pl|shtml|shtm|html|htm)$"

And exclude syntax using lookahead from what I've understood should be like this:
Code: [Select]
"^(?!\.php|?!\.cgi|?!\.pl|?!\.shtml|?!\.shtm|?!\.html|?!\.html)"
Is this correct?

 

Offline Fury

  • The Curmudgeon
  • 213
Re: Perl regular expression help
Never mind. I figured out something else that didn't involve regular expressions at all.