summaryrefslogtreecommitdiff
path: root/lisp/test/regex.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/test/regex.lsp')
-rw-r--r--lisp/test/regex.lsp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/test/regex.lsp b/lisp/test/regex.lsp
index fa6b2fe..9e28efa 100644
--- a/lisp/test/regex.lsp
+++ b/lisp/test/regex.lsp
@@ -438,3 +438,14 @@ foo" :notbol t :noteol t)
(setq re (re-comp "(.*a)?"))
(re-test '((0 . 1)) re "aaaa") ; expected, minimal match
(re-test '((0 . 1) (0 . 1)) re "aaaa" :count 2)
+
+
+;; Tue Dec 11 22:22:51 BRST 2007 Fix a regression with the pattern below
+;; returning a match to an empty string.
+;; Note that inverting the order of the "alternatives" works with the
+;; versions of libre prior to this (one line) fix
+(setq re (re-comp "\\\\\\d{3}|\\\\."))
+(re-test :nomatch re "\\")
+;; previous version should work with the pattern inverted
+(setq re (re-comp "\\\\.|\\\\\\d{3}"))
+(re-test :nomatch re "\\")