Re: problem with subpatterns in TPRegexp

From: Edmond Offermann <edmondoffermann_at_yahoo.com>
Date: Tue, 12 Sep 2006 18:47:14 -0700 (PDT)


Hi Anton,

Change your statement

TPRegexp(p1).Substitute(s1, r1); to TPRegexp(p1).Substitute(s1, r1,"",0,40);

This way you increase the maximum allowed sub-patterns . I agree that this argument to the pcre library is not clearly documented :
one would expect in your case (11 +1 ) *2 = 24 to be enough for start and stop positions of full + sub patterns and the default is 30 .

I will check the pcre library further and document TPRegexp accordingly .

Eddy

> Dear rooters,
>
> I have a problem with subpatterns in TPRegexp class:
> Usage of more than 9 subpatterns lead to segmentation violation
> error,
> but prce library itself support up to ~65000 subpatterns.
>
> Short macro and error log are attached.
> I test this problem on these configurations:
> 5.12/00 (SuSE 10.1 + gcc 4.1)
> 5.13/02 (WinXP)
> 5.10/00 (SLC 3.0.6 - from CERN AFS)
>
> --
> Best regards,
> Anton mailto:tosha_korneev_at_tut.by
Received on Wed Sep 13 2006 - 03:47:25 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET