Johan Sundström (Achtung Liebe!) @ Pike (-) developers forum 10353@lyskom.lysator.liu.se wrote:
If you don't have a PCRE enabled Pike, then there should be a solution with Regexp(). But it seems like there's a little bug with $ on Regexp(), but one bug at a time :)
Not if it is the stone age Regexp(), as that one did/does not handle strings with null characters in it (except in cases where you really *want* it to treat \0 as end-of-string).
Interresting to know.
\0 could be replaced beforehand using replace(), then Regexp() used. Even in this case, i guess we have a problem:
^ works: ----8<----8<----8<----8<----
string bar = "oofoo"; Regexp("^[o]+")->replace(bar, "");
(1) Result: "foo" ---->8---->8---->8---->8----
While $ seems not: ----8<----8<----8<----8<----
Regexp("[o]+$")->replace(bar, "");
(2) Result: "f" ---->8---->8---->8---->8----