in reply to Regex AND
It looks like you're using a bunch of negative look-ahead assertions to make sure your strings don't start with certain patterns. There are ways to combine them, but you'll have something that's a bit hairy and inefficient. I would rethink what you're parsing a bit, perhaps focusing on positive rather than negative matches for the data you want.
I recall there being a Regexp merging module on CPAN, but I've never used it and cannot find it at the moment. It might be helpful for you.
Check the regular expressions manpage here. I also recommend reading the Mastering Regular Expressions book (O'Reilly information is here and author's web site here) for a tutorial about optimizing regular expressions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex AND
by gaal (Parson) on Dec 02, 2004 at 12:59 UTC | |
by rickest (Novice) on Dec 02, 2004 at 17:01 UTC | |
by gaal (Parson) on Dec 02, 2004 at 17:20 UTC | |
by tphyahoo (Vicar) on Dec 03, 2004 at 20:03 UTC |