[Gambas-user] gb.pcre: RegExp.Replace() problem

Benoît Minisini gambas at ...1...
Sun Dec 21 14:33:36 CET 2014


Le 20/12/2014 09:27, Tobias Boege a écrit :
> Hi,
>
> attached is a script which essentially executes
>
>    Print RegExp.Replace(" * * a *", "^[ ]*\\*", "'")
>
> On my system the output is
>
>    '' a *
>
> which I don't understand. As the regular expression indicates I want only
> the one match at the beginning of the line to be replaced. Not the second
> one behind it. The "a" acts like a border, to see if the "^" is completely
> ignored -- but it isn't.
>
> The error seems to come from
>
> --8<-- [ trunk/gb.pcre/src/regexp.c ]---------------------------------------
> 389                         r.subject = &subject[offset];
> --8<------------------------------------------------------------------------
>
> I guess that this should prevent recursive (indefinite) substitutions in the
> replacement string... But if you ask me, the result of my script is wrong.
>
> Regards,
> Tobi
>
>

Mmm. I'm far from being a regexp user, but I will try to check that...

-- 
Benoît Minisini




More information about the User mailing list