in reply to Regex Nested Matching
First things first: What do you hope to achieve by fitting it all into a single regular expression? The usual results of that are things like puzzling the humans (including yourself months from now) who ultimately have to decipher your code, and causing the regex engine to wander back and forth through your string a lot (which it's happy to do, but not necessarily very efficient at.) If it's logical from the standpoint of reading and maintaining the code to use 2 regexes, use 2 regexes.
Also, if your data is in a standard markup language, you may well be happier using a library to parse it, rather than hand-rolling a regex to do it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex Nested Matching
by Rodster001 (Pilgrim) on Feb 24, 2010 at 22:33 UTC | |
by SuicideJunkie (Vicar) on Feb 25, 2010 at 14:41 UTC |