in reply to simple regular expression
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.
|
|---|