in reply to Re^2: Problem with a text-parsing regex
in thread Problem with a text-parsing regex
I'd never thought about using a character-at-a-time approach as you did to handle the first problem. I just assumed it would be much less efficient than trying to use [[:word:]]+, for example.
It will be less efficient - but I would always recommend solving the problem first, and worrying about optimization second.
In the general case, a regular expression that has to invoke more regops (regexp operations) will usually be slower than one that invokes fewer; but the cost will be less than invoking more ops at the perl level.
|
|---|