Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Modifying muliple matched strings in text

by tybalt89 (Prior)
on Jul 12, 2020 at 15:01 UTC ( #11119220=note: print w/replies, xml ) Need Help??


in reply to Modifying muliple matched strings in text

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11119206 use warnings; my $text = "blah blah [click me](click me) more stuff\nblah [link here +](link here) blah blah"; s!]\(\K.*?\)! '/' . $& =~ tr~ ~-~r !ge for $text; print "$text\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2021-04-23 18:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?