Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to make only two of three substitutions?

by tommyw (Hermit)
on Oct 15, 2002 at 13:30 UTC ( #205368=note: print w/replies, xml ) Need Help??


in reply to How to make only two of three substitutions?

Oh well, if everybody's joining in:

s|/{2,}|/|;
which will remove an unlimited number of extra slashes.

And if you've got multiline strings: s|(?:/\n){2,}|/\n|;

--
Tommy
Too stupid to live.
Too stubborn to die.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2019-10-23 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?