Mirar @ Pike developers forum 10353@lyskom.lysator.liu.se wrote:
Aha!
Well, it seems like those two are depending on the end of the previous hit a little too much. This gives a more appropriate behaviour:
/home/mirar/.zshenv:21: HISTCHARS can only contain ASCII characters Index: module.pmod.in =================================================================== RCS file:
/pike/data/cvsroot/Pike/7.7/src/modules/_Regexp_PCRE/module.pmod.in,v
retrieving revision 1.8 diff -u -r1.8 module.pmod.in --- module.pmod.in 19 Feb 2004 13:53:38 -0000 1.8 +++ module.pmod.in 16 Apr 2008 13:11:53 -0000 @@ -133,7 +133,7 @@ if (stringp(with)) res->add(with); else res->add(with(subject[v[0]..v[1]-1]));
i=v[1];
if (i!=v[1]) i=v[1]; else res->add(subject[i..i++]); } res->add(subject[i..]);
@@ -203,7 +203,7 @@ if (intp(v) && !handle_exec_error([int]v)) return this; callback(split_subject(subject,v),v);
i=v[1];
}if (i!=v[1]) i=v[1]; else i++; }
Wonderful.
----8<----8<----8<----8<----
string foo = "foobar"; Regexp.PCRE("o+")->replace(foo,"");
(1) Result: "fbar"
Regexp.PCRE("o*")->replace(foo,"");
(2) Result: "fbar"
Regexp.PCRE("^o*")->replace(foo,"");
(3) Result: "foobar"
Regexp.PCRE("o*$")->replace(foo,"");
(4) Result: "foobar"
Regexp.PCRE("o+")->matchall(foo, lambda(mixed s){ werror("%O\n",s); } );
({ /* 1 element */ "oo" }) (5) Result: Regexp.PCRE.StudiedWidestring("o+")
Regexp.PCRE("o*")->matchall(foo, lambda(mixed s){ werror("%O\n",s); } );
({ /* 1 element */ "" }) ({ /* 1 element */ "oo" }) ({ /* 1 element */ "" }) ({ /* 1 element */ "" }) ({ /* 1 element */ "" }) ({ /* 1 element */ "" }) (6) Result: Regexp.PCRE.StudiedWidestring("o*") ---->8---->8---->8---->8----
Should be applied to 7.6 too.
Thanx,
pike-devel@lists.lysator.liu.se