in reply to alternation in regexes: to use or to avoid?
It's not clear to me what you are trying to achieve with your regex.
The simple grouping that look like this
aol\s*\w+|aachen\s*\w+|aaliyah\s*\w+|.....runs quickly, it's only the one with lots of capture groups that is slow. i.e
(aol)\s*\w+|(aachen)\s*\w+|(aaliyah)\s*\w+|....So maybe there's just a better way to get the result you want, if you'd care to explain what that is?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: alternation in regexes: to use or to avoid?
by balker (Novice) on Dec 10, 2012 at 15:51 UTC | |
by RichardK (Parson) on Dec 10, 2012 at 16:08 UTC | |
Re^2: alternation in regexes: to use or to avoid?
by dk (Chaplain) on Dec 10, 2012 at 16:07 UTC |
In Section
Seekers of Perl Wisdom