Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: csv'ish string with parens that include commas

by ascetic (Novice)
on Dec 05, 2010 at 04:07 UTC ( #875455=note: print w/replies, xml ) Need Help??


in reply to Re: csv'ish string with parens that include commas
in thread csv'ish string with parens that include commas

Thanks. Actually, some of the args will be numbers, but I should be able to take it from here.

I also looked at using Text::Balanced for a bit, but it seemed like using a hammer to drive a screw.

Replies are listed 'Best First'.
Re^3: csv'ish string with parens that include commas
by james2vegas (Chaplain) on Dec 05, 2010 at 04:11 UTC
    \w matches letters, digts and underscore, so that should be sufficient.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://875455]
help
Chatterbox?
[ovedpo15]: another question about regex. if I have a string like this: "a/b/,c/d/e,5" I would like to remove the string after the last comma so the output will be "a/b/,c/d/e" how to do so?
[Corion]: ovedpo15: You could split on comma, and then join everything together, except the last part. Or you could match and make sure that the last part has no comma, like qr!,[^,]+$!, or you could use rindex.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2018-05-27 10:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?