in reply to Re: Whats your favorite nonstandard regex quote char?
in thread Whats your favorite nonstandard regex quote char?
A word of caution re: using ' as a regex delimiter, if the regex includes vars that you want interpreted, the regex won't do what you want when you use 's--as in this case for instance.
$s ='25 {fred and barney} text 2.36 12.0 {bam bam} text {pebbles}'; $n=0; $s =~ s'{.*?}'{$sub[$n++]}'g; print $s; 25 {$sub[$n++]} text 2.36 12.0 {$sub[$n++]} text {$sub[$n++]}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Whats your favorite nonstandard regex quote char?
by The Mad Hatter (Priest) on Apr 22, 2003 at 21:58 UTC |