Regex fixes (latest CVS this time)

Paolo Bonzini bonzini@gnu.org
Sat Sep 20 14:13:00 GMT 2003


I downloaded the latest CVS; it fixes one of the XFAILs in sed; five remain,
I'll send details soon.

I found a possible out of bounds left shift.  The first of these two patches
fixes it, together with a bug in which \(^ was wrongly parsed as an anchor.
Doing lookbehind in this case is wrong, instead it is ok for treating ^ as
special if coming after a new-line character, and lookahead is ok for
checking if $ is special.  You should pass state down from the parser: I
used the syntax bits for this, it may not be nice but it is simple and does
not waste an entire parameter.

The other patch implements \s and \S, which were in the old regex but not in
the new one; info on the places to touch came from a sed user but I redid
the patch to be more general (so it would be easier to implement \d and \D).
This patch applies on top of the other.

Thanks,

Paolo




-------------- next part --------------
A non-text attachment was scrubbed...
Name: regex-fixes-2003-09-20.patch
Type: application/octet-stream
Size: 3637 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20030920/0b776119/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regex-implement-slash-s.patch
Type: application/octet-stream
Size: 3809 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20030920/0b776119/attachment-0001.obj>


More information about the Libc-alpha mailing list