in reply to Regexp Question

Those nested brackets make me think of Text::Balanced. Maybe that would be more convenient.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re:^2 Regexp Question
by flounder99 (Friar) on Jun 11, 2002 at 16:49 UTC
    Or you could try Damian's Regexp::Common
    use Regexp::Common; use strict; my @examples = ( '${ThisOne}', 'do not match me %{}', '${This${One}}', '${This${One}Too}', '${This${One}and${also}this}', 'me either $}', 'dont match this line noise {} $ }{' ); foreach (@examples){ print "$_\n" if /(\$$RE{balanced}{-parens=>'{}'})/; } my $longstring = join "", @examples; print "\n", join ("\n", $longstring =~ /(\$$RE{balanced}{-parens=>'{}'})/g); __OUTPUT__ ${ThisOne} ${This${One}} ${This${One}Too} ${This${One}and${also}this} ${ThisOne} ${This${One}} ${This${One}Too} ${This${One}and${also}this}

    flounder