Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: simple regex problem

by blakem (Monsignor)
on Mar 07, 2003 at 00:27 UTC ( #241042=note: print w/ replies, xml ) Need Help??


in reply to Re: simple regex problem
in thread simple regex problem

I like this approach (its the only one listed that fits the "only two" spec) but what happens if there is only one space?

"this    hasonlyonespace" => "this hasonlyonespace"

How about:

$line =~ s/\s+/ /g; $line =~ s/ /:/ for (1,2);

-Blake


Comment on Re: Re: simple regex problem
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (14)
As of 2014-07-29 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (217 votes), past polls