Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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: (7)
As of 2015-07-04 02:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls