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++]}

Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

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
    Ooh! Thank you for pointing out that caveat. It will no doubt someday save me hours of debugging time. ;-)