in reply to Misunderstood regexp

There is no need to match non-greedily on the post-decimal digits: s{ (-? \d+ \.? \d* ) --? \d+ \. \d* }{$1}x should be fine.
_____________________________________________________
Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: Misunderstood regexp
by moonunit (Initiate) on Jul 28, 2004 at 10:39 UTC
    Thanks very much. It was indeed an unnecessarily stingy expression. Call me paranoid...