bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regexp regressions


From: Sam Steingold
Subject: regexp regressions
Date: Fri, 05 Aug 2005 11:37:57 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt)

the latest and greatest gnulib regexp has the following regressions vs
the previous (monolithic) version:

(defun re-test (pattern string)
  (mapcar (lambda (match)
            (and match (regexp:match-string string match)))
          (multiple-value-list
           (regexp:regexp-exec (regexp:regexp-compile pattern :extended t)
                               string))))

Form: (RE-TEST "(^)*" "-")
CORRECT: ("" "")
CLISP  : ("" NIL)
Differ at position 1: "" vs NIL
CORRECT: ("")
CLISP  : (NIL)

Form: (RE-TEST "([xyz])(-\\2)" "x-y")
CORRECT: NIL
CLISP  : ERROR
REGEXP:REGEXP-COMPILE ("([xyz])(-\\2)"): "Invalid back reference"


Form: (RE-TEST "((.*)\\1)+" "xxxxxx")
CORRECT: NIL
CLISP  : ERROR
REGEXP:REGEXP-COMPILE ("((.*)\\1)+"): "Invalid back reference"


Form: (RE-TEST "(.*)*\\1" "xx")
CORRECT: ("xx" "")
CLISP  : ("xx" "x")
Differ at position 1: "" vs "x"
CORRECT: ("")
CLISP  : ("x")

Form: (RE-TEST "(a*)*" "aaaa")
CORRECT: ("aaaa" "")
CLISP  : ("aaaa" "aaaa")
Differ at position 1: "" vs "aaaa"
CORRECT: ("")
CLISP  : ("aaaa")

Form: (RE-TEST "(a*)+" "aaaa")
CORRECT: ("aaaa" "")
CLISP  : ("aaaa" "aaaa")
Differ at position 1: "" vs "aaaa"
CORRECT: ("")
CLISP  : ("aaaa")


-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.honestreporting.com> <http://www.jihadwatch.org/>
<http://www.memri.org/> <http://www.iris.org.il> <http://pmw.org.il/>
WHO ATE MY BREAKFAST PANTS?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]