Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: s///g within m//g regions (updated)

by LanX (Sage)
on Nov 09, 2021 at 14:11 UTC ( #11138618=note: print w/replies, xml ) Need Help??


in reply to Re^4: s///g within m//g regions
in thread s///g within m//g regions

that's very different because there are no lines in between.

use strict; use warnings; use Test::More; my $in = 'A |simple*example| is |so*simple| to come*up |with these*days| according to some *experts*'; my $exp = 'A |simple-example| is |so-simple| to come*up |with these-days| according to some *experts*'; my $start = qr/\|/; my $stop = qr/\|/; my $got = $in; $got =~ s[ ($start) (.*?) ($stop) ][ "$1" . ( $2 =~ tr/\*/-/r ) . "$3" ]gsxe; is($got,$exp); done_testing;

updates
added
  • test
  • line-break

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2022-01-21 18:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (59 votes). Check out past polls.

    Notices?