-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 1/23/10 9:46 PM, Daniel Colascione wrote: > Add this somewhere in retest.c: > > test_comp("^(?:(hello)|($))", REG_EXTENDED, 0); > test_exec("hello asdf", REG_OK, 0, 5, -1, -1, END); > > The ($) subgroup matches (with an empty match) even though it shouldn't > (because we're not at the end of the string).
By the way: '^(?:(hello)|($?$))' seems to match the same strings, but not exhibit the phantom match behavior. (Or $+, or ${1,1}, or seemingly anything else that forces TRE to allocate an additional state. According to the debug output, the compiler is using the same (!) tags for subgroups 1 and 2 in the original example.) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) iEYEARECAAYFAktbwuoACgkQ17c2LVA10Vu/HwCfUIKgLwNYb1Jn8V7mah6HthVG 00wAn1tVAhYUPnHqg+SDtj+mlnvC1kZc =dFsF -----END PGP SIGNATURE----- _______________________________________________ TRE-general mailing list tre-general@laurikari.net http://laurikari.net/mailman/listinfo/tre-general http://laurikari.net/tre/