Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: String manipulation

by citromatik (Curate)
on Jun 24, 2009 at 11:22 UTC ( #774355=note: print w/replies, xml ) Need Help??


in reply to Re^2: String manipulation
in thread String manipulation

Sure:

my $rx = qr/ ^ # At the beginning of the string ( # Capture in $1 (?: # Paren for grouping (don't capture in $2) \w # match a "wordy" character (?: # paren for grouping, \s+|\z # match at least one space or the end of the + string ) )* # zero or more times ) # end of capture $1 (.*) # and match what comes after storing it in $ +2 /x # allow these comments ;

The rationale is to match at the beginning all the one-character strings, storing them in $1. The rest of the input will be catched in $2

citromatik

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://774355]
help
Chatterbox?
and the shadows deepen...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2017-02-20 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (294 votes). Check out past polls.