Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: simple regex problem

by allolex (Curate)
on Mar 06, 2003 at 22:55 UTC ( [id://241025]=note: print w/replies, xml ) Need Help??


in reply to simple regex problem

s/\s+/:/g
or
s/[ ]+/:/g
\s = space-like things, like tabs
+ = one or more
[ ] = just a normal space

You might want to have a look at perldoc perlre. What you have matches anything (".") twice and then one or more spaces, replacing them all with a colon.

--
Allolex

Update: I updated this page a whole lot of times, adding more and more info each time. Silly, isn't it?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 02:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found