Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Multiple Regex, it works but it aint clever

by Basilides (Friar)
on Aug 06, 2002 at 12:41 UTC ( [id://188000]=note: print w/replies, xml ) Need Help??


in reply to Multiple Regex, it works but it aint clever

I guess you're trying to shorten & standardise equity names, so it doesn't really matter what the issue price was, so you could merge all your EUR lines into one:  s/( EUR\d*)[^,]+//. Same for CHF, Y etc.

As for the dollar currencies, mind out because at the moment I think you've forgotten to escape a $ sign in $long =~s/\s+$//g;. I think you could catch all of 'em--C$, AU$, plain $, etc--with something like s/([\s+]?\$)[^,]+//g. (This may not be exactly right, but perhaps another helpful monk could put it right if it's not).

HTH

Replies are listed 'Best First'.
Re: Re: Multiple Regex, it works but it aint clever
by {NULE} (Hermit) on Aug 06, 2002 at 12:51 UTC
    Chances are that $long =~s/\s+$//g; is there to remove trailing white-space. Of course the g modifier is a bit pointless.

    {NULE}
    --
    http://www.nule.org

Re: Re: Multiple Regex, it works but it aint clever
by alexiskb (Acolyte) on Aug 06, 2002 at 13:37 UTC
    perfect, thank you kindly monks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://188000]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-24 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found