Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: how to search and replace the match with specific number of times in a string

by markkawika (Monk)
on Jan 29, 2010 at 19:26 UTC ( [id://820388]=note: print w/replies, xml ) Need Help??


in reply to Re^3: how to search and replace the match with specific number of times in a string
in thread how to search and replace the match with specific number of times in a string

That's one way, but I think a negative look-ahead would serve you better in this specific case:
$s =~ s/\*(?!\n)/*\n/;
Also, you don't need to escape the * in the replacement string.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-09-09 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.