Needs more cowbell /es. And slightly different quoting.
#/usr/bin/perl -w use strict; my $text= "start \\chapter{hello}\n end\n"; my $inpattern = qr/\\chapter\{(.*)\}/; my $outpattern = q{" -- FOUND $1 -- "}; $text =~ s/$inpattern/$outpattern/gee; print "$text\n";
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: simple regular expression
by Fletch
in thread simple regular expression
by iaw4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |