Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: split delimiters

by busunsl (Vicar)
on Mar 27, 2001 at 01:26 UTC ( #67340=note: print w/ replies, xml ) Need Help??


in reply to split delimiters

Since ( and [ are special characters in regular expressions, you have to escape them:

split /\(/, 'some(odd(string'; split /\[/, 'next[odd[string';


Comment on Re: split delimiters
Download Code
Re: Re: split delimiters
by Daddio (Chaplain) on Mar 27, 2001 at 04:14 UTC
    Or, just in case both of these delimiters should be used for one split...

    split /[\[\(]/, 'some(next[really(really(odd[string';
      Well, in that case you don't have to escape them, because they are in sqare brackets:
      split /[([]/, 'some(wierd[string';

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2014-07-26 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls