develooper Front page | perl.perl5.porters | Postings from October 1999

regexp in 5.005_61: (?{...})

Thread Next
From:
Konovalov, Vadim
Date:
October 1, 1999 01:13
Subject:
regexp in 5.005_61: (?{...})
Message ID:
402099F49BEED211999700805FC7359F20DA85@ru0028exch01.spb.lucent.com
Hello.

While ramblering in Perl's regexp source I've noticed that (?{...})
construction is parsed in regcomp.c in too simplified way.
So following mis-feature exists:

perl -e '/(?{print "Hello"})/'
prints Hello

perl -e '/(?{print "Hello{}"})/'
prints Hello{}

BUT
perl -e '/(?{print "Hello{"})/'
explains:
Sequence (?{...}) not terminated or not {}-balanced at -e line 1, within
pattern
/(?{print "Hello{"})/: Sequence (?{...}) not terminated or not {}-balanced
at -e
 line 1.

I know, it is a very experimental feature, but anyway, parsing need to be
more complicated in this case.

Good luck,
Vadim.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About