Hard Light Productions Forums

Off-Topic Discussion => Programming => Topic started by: Fury on February 18, 2011, 04:53:02 am

Title: Perl regular expression help
Post by: Fury on February 18, 2011, 04:53:02 am
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?
Title: Re: Perl regular expression help
Post by: Fury on February 18, 2011, 10:58:08 am
Never mind. I figured out something else that didn't involve regular expressions at all.