Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: regex to split on ' ', but skip spaces inside quotes (3WTDI)

by tye (Sage)
on Sep 21, 2007 at 23:51 UTC ( [id://640457]=note: print w/replies, xml ) Need Help??


in reply to regex to split on ' ', but skip spaces inside quotes

my @words= $string =~ /'[^']*'|\S+/g; my @words= $string =~ /'(?:\\.|[^\\']+)*'|\S+/gs; my @words= $string =~ /'(?:''|[^']+)*'|\S+/g;

- tye        

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-18 08:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found