Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by loki (Novice)
on Jan 29, 2010 at 13:47 UTC ( [id://820356]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $s="***ab***c"; 
    $s=~s{\*}{\*\n} for 1..2; 
    print$s;
    
  2. or download this
    my output was:
    *
    
    **ab***c
    
  3. or download this
    *
    *
    *ab***c
    

Log In?
Username:
Password:

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

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

    No recent polls found