in reply to simplifying an expression

Hmm... I don't have an answer for you, but out of curiosity -- would I be correct if I observed that it seemed like you were trying to parse up Bloomberg.com's Currency pages?

Or at least they look a lot like the pages I wrote for them. :)


Okay... I have something. I believe is is somewhat less cumbersome, but I do not have the time to Benchmark the difference.

while ($string =~ s/<TR.+?([^\)>]+\))<.+?(\d+\.\d+)//s) { print "$1 -- $2 \n"; } <TR <-- locates the start of each row. .+? <-- will slurp up lots of chars, but not greedy ([^\)>]+\)) <-- will grab the currency name, $1 <.+? <-- slurp more, not greedy (\d+\.\d+) <-- will grab the currency value, $2

I hope this is some help.

Edit 2001-04-20 by tye

Replies are listed 'Best First'.
Re: Re: simplifying an expression
by Sifmole (Chaplain) on Apr 20, 2001 at 16:39 UTC

    Sorry! I have no idea how my posting ended up in the primary area. I beg your pardon.


    Okay... I have something. I believe is is somewhat less cumbersome, but I do not have the time to Benchmark the difference.

    while ($string =~ s/<TR.+?([^\)>]+\))<.+?(\d+\.\d+)//s) { print "$1 -- $2 \n"; } <TR <-- locates the start of each row. .+? <-- will slurp up lots of chars, but not greedy ([^\)>]+\)) <-- will grab the currency name, $1 <.+? <-- slurp more, not greedy (\d+\.\d+) <-- will grab the currency value, $2

    I hope this is some help.

    Edit 2001-04-20 by tye