replace bug?
Posted: Wed Aug 20, 2014 12:37 pm
I ran into the following, which seems like a bug in the regex pattern handling, illustrated in the following example:
Thus, when the pattern is within brackets, the replacement of char u8216 gets replicated into each of the source bytes, whereas without the brackets, the "proper" replacement occurs. The replace is also proper with the flags code 2048 raher than 0.
newLISP v.10.6.0 32-bit on Linux IPv4/6 UTF-8 libffi.
Code: Select all
> (map char (explode (replace "[‘’]" "‘" "x" 0)))
(120 120 120)
> (map char (explode (replace "‘" "‘" "x" 0)))
(120)
> (map char (explode (replace "[‘’]" "‘" "x" 2048)))
(120)
newLISP v.10.6.0 32-bit on Linux IPv4/6 UTF-8 libffi.