Scalar without /r
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11150123 use warnings; my $blockoftext = <<END; mouse cat 1 2 3 ^cat deer eel cat furbaby elk ^cat dog fish END $blockoftext =~ s/^cat.*?^\^cat/ my $catsection = $&; $catsection =~ s!^!#!gm; $catsection /gems; print $blockoftext;
In reply to Re: can u suggest a regex for this ?
by tybalt89
in thread can u suggest a regex for this ?
by misterperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |