Perl: the Markov chain saw | |
PerlMonks |
Re: Re: Re: parsing questionby kilinrax (Deacon) |
on May 28, 2003 at 11:06 UTC ( [id://261268]=note: print w/replies, xml ) | Need Help?? |
In a word, no.
Reversing the regex is much faster.
Output: Reversed: <<HTML>;nbsp dont_strip_me</HTML>> <xyzfdgfghgf> As you can see, it's over twice the speed. On longer strings, the difference would be even greater. Also, your regex is wrong. Read through perldoc:perlre (specifically, the section marked 'Warning on \1 vs $1') to discover why.
In Section
Seekers of Perl Wisdom
|
|