in reply to Re: Whats your favorite nonstandard regex quote char?
in thread Whats your favorite nonstandard regex quote char?

Paired delimiters such as []{}()<> do that, but I can't get used to them.

If it is the pairing you can't get used to, you could always just the right side of the pair. :) e.g.

$s =~ s>{.*?} >{$sub[$n++]}>gx; $s =~ s){.*?} ){$sub[$n++]})gx;

Personally I tend to use ! because of the rarity of having to match a ! in a string, or having a negative look-ahead/behind assertions. I do like the way the pipe looks but tend to avoid it because it is the character for alternation.

-enlil

Replies are listed 'Best First'.
Re^3: Whats your favorite nonstandard regex quote char?
by LAI (Hermit) on Apr 23, 2003 at 14:08 UTC

    Yeah, the half-pair is fun. Personally I would have split up that re as:

    $s =~ s>{.*?} >{$sub[$n++]} >gx;

    ...but TIMTOWTDI. And as for the pipe being the character for alternation... you're right of course. But not many characters are used infrequently enough that they make good delimiters. So I just use whichever I feel looks good until there's a conflict with the content of the regex.

    LAI

    __END__