Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Trouble splitting pipe delimited

by BillKSmith (Priest)
on Nov 05, 2012 at 02:41 UTC ( #1002265=note: print w/replies, xml ) Need Help??


in reply to Trouble splitting pipe delimited

The module may be needed for more complex cases, but split can handle this one. Note use of negative look behind in the regular expression.

$_ = '1|str|foo\|bar|goo|2323'; $, = ','; print split /(?<!\\)\|/;

Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002265]
help
Chatterbox?
[LanX]: never lad_ena!
[LanX]: ;)
[Lady_Aleena]: IMO, Fancy::Join:: Grammatical isn't bad, but RolePlaying:: WorldBuilding:: WorldBuildersGuide book::ClimateTerra inSubsistance is on the long side.
[Lady_Aleena]: I'm still in reorganizing/ renaming mode.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2017-05-24 22:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?