Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 browsing the Monastery: (3)
As of 2014-09-24 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls