in reply to Regex optimization

For both readability and a little bit of speed try:
@results = $str =~ m/>([^<\n]+)</g;
Then validate the elements of the array if you need to. -- iakobski

Replies are listed 'Best First'.
Re: Re: Regex optimization
by deryni (Beadle) on May 08, 2001 at 20:25 UTC
    I believe I have mislead you, the new lines in the html are in my representation only not in the original. As I said it is the most badly formatted html I've ever seen.

        -Etan
      Even easier:
      @results = $str =~ m/>([^<]+)</g;

      -- iakobski