From 90ebc6b012a33a497f3d35f08fad0f3221fbd33b Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 26 Dec 2013 21:26:12 -0500 Subject: [PATCH 001/130] Add RECURSIVE-SUBPATTERN class. --- regex-class.lisp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/regex-class.lisp b/regex-class.lisp index 43c36e5..55840b4 100644 --- a/regex-class.lisp +++ b/regex-class.lisp @@ -255,6 +255,19 @@ defined by the user.")) () (:documentation "VOID objects represent empty regular expressions.")) +(defclass recursive-subpattern (regex) + ((num :initarg :num + :accessor num + :type fixnum + :documentation "The number of the register this subpattern reference +refers to.") + (name :initarg :name + :accessor name + :documentation "The name of the register this subpattern reference +refers to or NIL.")) + (:documentation "RECURSIVE-SUBPATTERN objects represent subpattern references + for matching self-similar strings like nested parentheses.")) + (defmethod initialize-instance :after ((str str) &rest init-args) (declare #.*standard-optimize-settings*) (declare (ignore init-args)) From bf196751072bd299586070c0f0d66c6621e503a2 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 26 Dec 2013 22:09:18 -0500 Subject: [PATCH 002/130] Add lexer tokens for (?R) and (?&NAME) sequences. --- lexer.lisp | 29 +++++++++++++++++++++++++---- parser.lisp | 2 ++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/lexer.lisp b/lexer.lisp index 032b5ca..6ae2af7 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -693,11 +693,32 @@ closing #\> will also be consumed." ;; also syntax error (signal-syntax-error* (1- (lexer-pos lexer)) "Character '~A' may not follow '(?<'." - next-char )))))) + next-char)))))) + ((#\&) + ;; subpattern reference by register name + (unless *allow-named-registers* + (signal-syntax-error* (1- (lexer-pos lexer)) + "Character '~A' may not follow '(?'." + next-char)) + (let ((next-char (next-char-non-extended lexer))) + (if (alpha-char-p next-char) + (progn + ;; put the letter back + (decf (lexer-pos lexer)) + :open-paren-ampersand) + (signal-syntax-error* (1- (lexer-pos lexer)) + "Character '~A' may not follow '(?&'." + next-char)))) (otherwise - (signal-syntax-error* (1- (lexer-pos lexer)) - "Character '~A' may not follow '(?'." - next-char))))) + (if (digit-char-p next-char) + ;; subpattern reference by register number + (progn + ;; put the digit back + (decf (lexer-pos lexer)) + :open-paren-digit) + (signal-syntax-error* (1- (lexer-pos lexer)) + "Character '~A' may not follow '(?'." + next-char)))))) (t ;; if next-char was not #\? (this is within ;; the first COND), we've just seen an opening diff --git a/parser.lisp b/parser.lisp index 72e39e9..e260868 100644 --- a/parser.lisp +++ b/parser.lisp @@ -38,6 +38,7 @@ (defun group (lexer) "Parses and consumes a . The productions are: -> \"\(\"\")\" + \"\(?\"\")\" \"\(?:\"\")\" \"\(?>\"\")\" \"\(?:\"\")\" @@ -48,6 +49,7 @@ The productions are: -> \"\(\"\")\" \"\(?\(\"\")\"\")\" \"\(?\(\"\")\"\")\" \"\(?\"\")\" \(when *ALLOW-NAMED-REGISTERS* is T) + \"\(?&\"\")\" \(when *ALLOW-NAMED-REGISTERS* is T) where is parsed by the lexer function MAYBE-PARSE-FLAGS. Will return or \( ) where From 9bf3bf01fc718987920ff67e29502ab1efff3ed5 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 06:06:26 -0500 Subject: [PATCH 003/130] Use CASE option instead of IF expression. --- lexer.lisp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lexer.lisp b/lexer.lisp index 6ae2af7..e790eb6 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -709,16 +709,14 @@ closing #\> will also be consumed." (signal-syntax-error* (1- (lexer-pos lexer)) "Character '~A' may not follow '(?&'." next-char)))) + ((#\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) + ;; put the digit back + (decf (lexer-pos lexer)) + :open-paren-digit) (otherwise - (if (digit-char-p next-char) - ;; subpattern reference by register number - (progn - ;; put the digit back - (decf (lexer-pos lexer)) - :open-paren-digit) - (signal-syntax-error* (1- (lexer-pos lexer)) - "Character '~A' may not follow '(?'." - next-char)))))) + (signal-syntax-error* (1- (lexer-pos lexer)) + "Character '~A' may not follow '(?'." + next-char))))) (t ;; if next-char was not #\? (this is within ;; the first COND), we've just seen an opening From 35c05dd0b80d49690d92d69abdf9c92247a0762f Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 08:50:21 -0500 Subject: [PATCH 004/130] Optionally make PARSE-REGISTER-NAME-AUX parse from within (?&name) construct. --- lexer.lisp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lexer.lisp b/lexer.lisp index e790eb6..fbe35c2 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -472,18 +472,22 @@ resets the lexer to its old position." (otherwise (fail lexer))))) -(defun parse-register-name-aux (lexer) - "Reads and returns the name in a named register group. It is -assumed that the starting #\< character has already been read. The -closing #\> will also be consumed." - ;; we have to look for an ending > character now - (let ((end-name (position #\> +(defun parse-register-name-aux (lexer &key subpattern-reference) + "Reads and returns the name in a named register group or reference. It is +assumed that the starting #\\< character \(or \"\(?&\" string when +SUBPATTERN-REFERENCE is true) has already been read. The closing #\> \(or #\\)) +will also be consumed." + ;; we have to look for an ending > or ) character now + (let ((end-name (position (if subpattern-reference #\) #\>) (lexer-str lexer) :start (lexer-pos lexer) :test #'char=))) (unless end-name - ;; there has to be > somewhere, syntax error otherwise - (signal-syntax-error* (1- (lexer-pos lexer)) "Opening #\< in named group has no closing #\>.")) + ;; there has to be > or ) somewhere, syntax error otherwise + (signal-syntax-error* (1- (lexer-pos lexer)) + (if subpattern-reference + "Opening \"(?&\" in named group has no closing #\\)." + "Opening #\\< in named group has no closing #\\>."))) (let ((name (subseq (lexer-str lexer) (lexer-pos lexer) end-name))) @@ -492,8 +496,8 @@ closing #\> will also be consumed." (char= #\- char))) name) ;; register name can contain only alphanumeric characters or #\- - (signal-syntax-error* (lexer-pos lexer) "Invalid character in named register group.")) - ;; advance lexer beyond "" part + (signal-syntax-error* (lexer-pos lexer) "Invalid character in register name.")) + ;; advance lexer beyond "" (or "(?&name)") part (setf (lexer-pos lexer) (1+ end-name)) name))) From 5adc50cfd125d3ea4ec6763b4c7e77d390f3f6c2 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 09:45:38 -0500 Subject: [PATCH 005/130] Make (?+) and (?&NAME) constructs s. --- parser.lisp | 2 -- 1 file changed, 2 deletions(-) diff --git a/parser.lisp b/parser.lisp index e260868..72e39e9 100644 --- a/parser.lisp +++ b/parser.lisp @@ -38,7 +38,6 @@ (defun group (lexer) "Parses and consumes a . The productions are: -> \"\(\"\")\" - \"\(?\"\")\" \"\(?:\"\")\" \"\(?>\"\")\" \"\(?:\"\")\" @@ -49,7 +48,6 @@ The productions are: -> \"\(\"\")\" \"\(?\(\"\")\"\")\" \"\(?\(\"\")\"\")\" \"\(?\"\")\" \(when *ALLOW-NAMED-REGISTERS* is T) - \"\(?&\"\")\" \(when *ALLOW-NAMED-REGISTERS* is T) where is parsed by the lexer function MAYBE-PARSE-FLAGS. Will return or \( ) where From ca8f7234058c3fcc6482cd57f0c8ca3d387e7b42 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 09:46:24 -0500 Subject: [PATCH 006/130] Parse subpattern references correctly. --- lexer.lisp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lexer.lisp b/lexer.lisp index fbe35c2..f3e7957 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -704,19 +704,30 @@ will also be consumed." (signal-syntax-error* (1- (lexer-pos lexer)) "Character '~A' may not follow '(?'." next-char)) - (let ((next-char (next-char-non-extended lexer))) + (let ((next-char (next-char lexer))) (if (alpha-char-p next-char) + ;; FIXME: Does Perl allow whitespace around register name here? (progn ;; put the letter back (decf (lexer-pos lexer)) - :open-paren-ampersand) + (list :subpattern-reference + (parse-register-name-aux lexer :subpattern-reference t))) (signal-syntax-error* (1- (lexer-pos lexer)) "Character '~A' may not follow '(?&'." next-char)))) ((#\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) ;; put the digit back (decf (lexer-pos lexer)) - :open-paren-digit) + (prog1 + (list :subpattern-reference (get-number lexer :no-whitespace-p t)) + (let ((next-char (next-char lexer))) + (when (or (null next-char) + (not (char= (the character next-char) #\)))) + ;; closing ) missing or not in the proper position + ;; FIXME: Does Perl allow whitespace around number here? + (signal-syntax-error* + (1- (lexer-pos lexer)) + "Numbered subpattern reference has no closing #\\)."))))) (otherwise (signal-syntax-error* (1- (lexer-pos lexer)) "Character '~A' may not follow '(?'." From da2bba6209948418669274101b544c37e39179b9 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 09:53:58 -0500 Subject: [PATCH 007/130] Make note to support (?0) and (?R). --- lexer.lisp | 1 + 1 file changed, 1 insertion(+) diff --git a/lexer.lisp b/lexer.lisp index f3e7957..faa3c4a 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -716,6 +716,7 @@ will also be consumed." "Character '~A' may not follow '(?&'." next-char)))) ((#\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) + ;; FIXME: Add support for (?0), AKA (?R). ;; put the digit back (decf (lexer-pos lexer)) (prog1 From 6a493f8c0a7922a37ef021b29cec57c8e261f4b5 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 12:22:21 -0500 Subject: [PATCH 008/130] Rename RECURSIVE-SUBPATTERN -> SUBPATTERN-REFERENCE. --- regex-class.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regex-class.lisp b/regex-class.lisp index 55840b4..2d1fc2f 100644 --- a/regex-class.lisp +++ b/regex-class.lisp @@ -255,7 +255,7 @@ defined by the user.")) () (:documentation "VOID objects represent empty regular expressions.")) -(defclass recursive-subpattern (regex) +(defclass subpattern-reference (regex) ((num :initarg :num :accessor num :type fixnum @@ -265,7 +265,7 @@ refers to.") :accessor name :documentation "The name of the register this subpattern reference refers to or NIL.")) - (:documentation "RECURSIVE-SUBPATTERN objects represent subpattern references + (:documentation "SUBPATTERN-REFERENCE objects represent subpattern references for matching self-similar strings like nested parentheses.")) (defmethod initialize-instance :after ((str str) &rest init-args) From 95c400a439a0ff4e1398e944727ee97aab58f4a6 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 14:04:49 -0500 Subject: [PATCH 009/130] Beginnings of code to check for invalid subpattern references. --- convert.lisp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/convert.lisp b/convert.lisp index d57674b..50379fc 100644 --- a/convert.lisp +++ b/convert.lisp @@ -857,16 +857,22 @@ or an EVERYTHING object \(if the regex starts with something like (reg-num 0) reg-names named-reg-seen + named-subpattern-refs-seen (accumulate-start-p t) starts-with (max-back-ref 0) + (max-subpattern-ref 0) (converted-parse-tree (convert-aux parse-tree))) - (declare (special flags reg-num reg-names named-reg-seen - accumulate-start-p starts-with max-back-ref)) + (declare (special flags reg-num reg-names named-reg-seen accumulate-start-p + starts-with max-back-ref max-subpattern-ref named-subpattern-refs-seen)) ;; make sure we don't reference registers which aren't there (when (> (the fixnum max-back-ref) (the fixnum reg-num)) (signal-syntax-error "Backreference to register ~A which has not been defined." max-back-ref)) + (when (> (the fixnum max-subpattern-ref) + (the fixnum reg-num)) + (signal-syntax-error "Subpattern reference to register ~A which has not been defined." + max-subpattern-ref)) (when (typep starts-with 'str) (setf (slot-value starts-with 'str) (coerce (slot-value starts-with 'str) @@ -876,4 +882,10 @@ or an EVERYTHING object \(if the regex starts with something like ;; we can't simply use *ALLOW-NAMED-REGISTERS* ;; since parse-tree syntax ignores it (when named-reg-seen + (let ((nonexistent-regs + (set-difference named-subpattern-refs-seen reg-names :test #'string=))) + (when nonexistent-regs + (signal-syntax-error + "Subpattern reference to named register ~A which has not been defined." + (car nonexistent-regs)))) (nreverse reg-names))))) From b4697b628ecaa427d5bd9c124cca1c18d6ab62df Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 14:10:16 -0500 Subject: [PATCH 010/130] Add to doc comment of CONVERT-AUX. --- convert.lisp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/convert.lisp b/convert.lisp index 50379fc..a07ed1e 100644 --- a/convert.lisp +++ b/convert.lisp @@ -312,6 +312,10 @@ it. Will also - keep track of all named registers seen in the special variable REG-NAMES - keep track of the highest backreference seen in the special variable MAX-BACK-REF, + - keep track of the highest subpattern reference seen in the special variable + MAX-SUBPATTERN-REF, + - keep track of all named subpattern references seen in the special variable + NAMED-SUBPATTERN-REFS-SEEN, - maintain and adher to the currently applicable modifiers in the special variable FLAGS, and - maybe even wash your car..." From ceecaf8073ef439a1f57c16559b7aaccf62b58a7 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 14:17:37 -0500 Subject: [PATCH 011/130] Add shell of method for handling subpattern reference parse-tree nodes. --- convert.lisp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/convert.lisp b/convert.lisp index a07ed1e..cbe877a 100644 --- a/convert.lisp +++ b/convert.lisp @@ -673,6 +673,10 @@ when NAME is not NIL." (t (make-back-ref backref-number)))))) +(defmethod convert-compound-parse-tree ((token (eql :subpattern-reference)) parse-tree &key) + "The case for parse trees like \(:SUBPATTERN-REFERENCE |)." + (signal-syntax-error "Subpattern references not yet supported.")) + (defmethod convert-compound-parse-tree ((token (eql :regex)) parse-tree &key) "The case for \(:REGEX )." (declare #.*standard-optimize-settings*) From 561228dcbcfad14f82ec7a35392e96a3a6ad6533 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 15:12:59 -0500 Subject: [PATCH 012/130] Give flesh to CONVERT-COMPOUND-PARSE-TREE. Be sure to keep track of named subpattern references as well as the highes numbered subpattern reference encountered. --- convert.lisp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/convert.lisp b/convert.lisp index cbe877a..1d2ccf3 100644 --- a/convert.lisp +++ b/convert.lisp @@ -675,6 +675,29 @@ when NAME is not NIL." (defmethod convert-compound-parse-tree ((token (eql :subpattern-reference)) parse-tree &key) "The case for parse trees like \(:SUBPATTERN-REFERENCE |)." + (declare #.*standard-optimize-settings*) + (declare (special max-subpattern-ref named-subpattern-refs-seen)) + ;; Subpattern references may refer to registers that come later in the regex, + ;; so we don't validate the subpattern name/number until the entire object has + ;; been constructed. + ;; FIXME: In Perl, which named subpattern is referred to when there are more + ;; than one subpatterns of the same name? + (let* ((reg (second parse-tree)) + (reg-name (and (stringp reg) reg)) + (reg-num (and (null reg-name) + (typep reg 'fixnum) + (plusp reg) + reg))) + (when (not (or reg-name reg-num)) + (signal-syntax-error "Illegal subpattern reference: ~S." parse-tree)) + (if reg-name + (pushnew reg-name named-subpattern-refs-seen :test #'string=) + (setf max-subpattern-ref (max max-subpattern-ref reg-num))) + (make-instance 'subpattern-reference + ;; For named references, register numbers will be computed + ;; later. + :num (or reg-num -1) + :name (copy-seq reg-name))) (signal-syntax-error "Subpattern references not yet supported.")) (defmethod convert-compound-parse-tree ((token (eql :regex)) parse-tree &key) From 82fdd7633ed341d452d312bd16ae367078b07825 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 27 Dec 2013 15:28:45 -0500 Subject: [PATCH 013/130] Rename variable NAMED-SUBPATTERN-REFS-SEEN -> NAMED-SUBPATTERN-REFS. --- convert.lisp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/convert.lisp b/convert.lisp index 1d2ccf3..fc999fb 100644 --- a/convert.lisp +++ b/convert.lisp @@ -315,7 +315,7 @@ it. Will also - keep track of the highest subpattern reference seen in the special variable MAX-SUBPATTERN-REF, - keep track of all named subpattern references seen in the special variable - NAMED-SUBPATTERN-REFS-SEEN, + NAMED-SUBPATTERN-REFS, - maintain and adher to the currently applicable modifiers in the special variable FLAGS, and - maybe even wash your car..." @@ -676,7 +676,7 @@ when NAME is not NIL." (defmethod convert-compound-parse-tree ((token (eql :subpattern-reference)) parse-tree &key) "The case for parse trees like \(:SUBPATTERN-REFERENCE |)." (declare #.*standard-optimize-settings*) - (declare (special max-subpattern-ref named-subpattern-refs-seen)) + (declare (special max-subpattern-ref named-subpattern-refs)) ;; Subpattern references may refer to registers that come later in the regex, ;; so we don't validate the subpattern name/number until the entire object has ;; been constructed. @@ -691,7 +691,7 @@ when NAME is not NIL." (when (not (or reg-name reg-num)) (signal-syntax-error "Illegal subpattern reference: ~S." parse-tree)) (if reg-name - (pushnew reg-name named-subpattern-refs-seen :test #'string=) + (pushnew reg-name named-subpattern-refs :test #'string=) (setf max-subpattern-ref (max max-subpattern-ref reg-num))) (make-instance 'subpattern-reference ;; For named references, register numbers will be computed @@ -888,14 +888,14 @@ or an EVERYTHING object \(if the regex starts with something like (reg-num 0) reg-names named-reg-seen - named-subpattern-refs-seen + named-subpattern-refs (accumulate-start-p t) starts-with (max-back-ref 0) (max-subpattern-ref 0) (converted-parse-tree (convert-aux parse-tree))) (declare (special flags reg-num reg-names named-reg-seen accumulate-start-p - starts-with max-back-ref max-subpattern-ref named-subpattern-refs-seen)) + starts-with max-back-ref max-subpattern-ref named-subpattern-refs)) ;; make sure we don't reference registers which aren't there (when (> (the fixnum max-back-ref) (the fixnum reg-num)) @@ -914,7 +914,7 @@ or an EVERYTHING object \(if the regex starts with something like ;; since parse-tree syntax ignores it (when named-reg-seen (let ((nonexistent-regs - (set-difference named-subpattern-refs-seen reg-names :test #'string=))) + (set-difference named-subpattern-refs reg-names :test #'string=))) (when nonexistent-regs (signal-syntax-error "Subpattern reference to named register ~A which has not been defined." From 514cb45eec23f5f623ad9f3604c2911a36c677b7 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 28 Dec 2013 07:38:42 -0500 Subject: [PATCH 014/130] Convert named subpattern refs to numbered subpattern refs inside CONVERT. Also, keep track of which registers have been referenced by number. --- convert.lisp | 65 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/convert.lisp b/convert.lisp index fc999fb..ef9c936 100644 --- a/convert.lisp +++ b/convert.lisp @@ -314,6 +314,8 @@ it. Will also variable MAX-BACK-REF, - keep track of the highest subpattern reference seen in the special variable MAX-SUBPATTERN-REF, + - keep track of all numbered subpattern references seen in the special + variable NUMBERED-SUBPATTERN-REFS, - keep track of all named subpattern references seen in the special variable NAMED-SUBPATTERN-REFS, - maintain and adher to the currently applicable modifiers in the special @@ -676,7 +678,7 @@ when NAME is not NIL." (defmethod convert-compound-parse-tree ((token (eql :subpattern-reference)) parse-tree &key) "The case for parse trees like \(:SUBPATTERN-REFERENCE |)." (declare #.*standard-optimize-settings*) - (declare (special max-subpattern-ref named-subpattern-refs)) + (declare (special max-subpattern-ref numbered-subpattern-refs named-subpattern-refs)) ;; Subpattern references may refer to registers that come later in the regex, ;; so we don't validate the subpattern name/number until the entire object has ;; been constructed. @@ -692,13 +694,14 @@ when NAME is not NIL." (signal-syntax-error "Illegal subpattern reference: ~S." parse-tree)) (if reg-name (pushnew reg-name named-subpattern-refs :test #'string=) - (setf max-subpattern-ref (max max-subpattern-ref reg-num))) + (progn + (setf max-subpattern-ref (max max-subpattern-ref reg-num)) + (pushnew reg-num numbered-subpattern-refs :test #'=))) (make-instance 'subpattern-reference ;; For named references, register numbers will be computed ;; later. :num (or reg-num -1) - :name (copy-seq reg-name))) - (signal-syntax-error "Subpattern references not yet supported.")) + :name (copy-seq reg-name)))) (defmethod convert-compound-parse-tree ((token (eql :regex)) parse-tree &key) "The case for \(:REGEX )." @@ -875,6 +878,34 @@ parse trees which are atoms.") (convert-aux (copy-tree translation)) (signal-syntax-error "Unknown token ~A in parse tree." parse-tree)))) +(defun convert-named-subpattern-refs (converted-tree) + "Convert named subpattern references to numbered references." + (declare #.*standard-optimize-settings*) + (declare (special reg-names reg-num numbered-subpattern-refs)) + (etypecase converted-tree + (subpattern-reference + (when (= -1 (num converted-tree)) + (let* ((reg-name (name converted-tree)) + ;; find which register corresponds to the given name + ;; FIXME: When multiple named registers exist, do we want + ;; references to refer to the _last_? + (regs (loop for name in reg-names + for reg-index from 0 + when (string= name reg-name) + collect (- reg-num reg-index)))) + (pushnew (first regs) numbered-subpattern-refs :test #'=) + (setf (num converted-tree) (first regs))))) + (seq + (mapc #'convert-named-subpattern-refs (elements converted-tree))) + (alternation + (mapc #'convert-named-subpattern-refs (choices converted-tree))) + ((or lookahead lookbehind repetition register standalone) + (convert-named-subpattern-refs (regex converted-tree))) + (branch + (mapc #'convert-named-subpattern-refs (list (then-regex converted-tree) + (else-regex converted-tree)))) + ((or str void)))) + (defun convert (parse-tree) "Converts the parse tree PARSE-TREE into an equivalent REGEX object and returns three values: the REGEX object, the number of registers @@ -888,14 +919,22 @@ or an EVERYTHING object \(if the regex starts with something like (reg-num 0) reg-names named-reg-seen + numbered-subpattern-refs named-subpattern-refs (accumulate-start-p t) starts-with (max-back-ref 0) (max-subpattern-ref 0) (converted-parse-tree (convert-aux parse-tree))) - (declare (special flags reg-num reg-names named-reg-seen accumulate-start-p - starts-with max-back-ref max-subpattern-ref named-subpattern-refs)) + (declare (special flags reg-num + reg-names + named-reg-seen + accumulate-start-p + starts-with + max-back-ref + max-subpattern-ref + numbered-subpattern-refs + named-subpattern-refs)) ;; make sure we don't reference registers which aren't there (when (> (the fixnum max-back-ref) (the fixnum reg-num)) @@ -904,6 +943,14 @@ or an EVERYTHING object \(if the regex starts with something like (the fixnum reg-num)) (signal-syntax-error "Subpattern reference to register ~A which has not been defined." max-subpattern-ref)) + (when named-subpattern-refs + (let ((nonexistent-regs + (set-difference named-subpattern-refs reg-names :test #'string=))) + (when nonexistent-regs + (signal-syntax-error + "Subpattern reference to named register \"~A\" which has not been defined." + (car nonexistent-regs)))) + (convert-named-subpattern-refs converted-parse-tree)) (when (typep starts-with 'str) (setf (slot-value starts-with 'str) (coerce (slot-value starts-with 'str) @@ -913,10 +960,4 @@ or an EVERYTHING object \(if the regex starts with something like ;; we can't simply use *ALLOW-NAMED-REGISTERS* ;; since parse-tree syntax ignores it (when named-reg-seen - (let ((nonexistent-regs - (set-difference named-subpattern-refs reg-names :test #'string=))) - (when nonexistent-regs - (signal-syntax-error - "Subpattern reference to named register ~A which has not been defined." - (car nonexistent-regs)))) (nreverse reg-names))))) From a2a9632559a08337f35252a2d44fd7ba8364aa77 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 28 Dec 2013 08:03:00 -0500 Subject: [PATCH 015/130] Return a fifth value from CONVERT, namely, the list of numbers of subpatterns referenced in the regex. --- api.lisp | 2 +- convert.lisp | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/api.lisp b/api.lisp index 21550e1..def03e5 100644 --- a/api.lisp +++ b/api.lisp @@ -103,7 +103,7 @@ modify its first argument \(but only if it's a parse tree).")) (when flags (setq parse-tree (list :group (cons :flags flags) parse-tree)))) (let ((*syntax-error-string* nil)) - (multiple-value-bind (regex reg-num starts-with reg-names) + (multiple-value-bind (regex reg-num starts-with reg-names subpattern-refs) (convert parse-tree) ;; simplify REGEX by flattening nested SEQ and ALTERNATION ;; constructs and gathering STR objects diff --git a/convert.lisp b/convert.lisp index ef9c936..b7c9e8b 100644 --- a/convert.lisp +++ b/convert.lisp @@ -907,11 +907,12 @@ parse trees which are atoms.") ((or str void)))) (defun convert (parse-tree) - "Converts the parse tree PARSE-TREE into an equivalent REGEX object -and returns three values: the REGEX object, the number of registers -seen and an object the regex starts with which is either a STR object -or an EVERYTHING object \(if the regex starts with something like -\".*\") or NIL." + "Converts the parse tree PARSE-TREE into an equivalent REGEX object and +returns five values: the REGEX object; the number of registers seen; an object +the regex starts with, which is either a STR object or an EVERYTHING object \(if +the regex starts with something like \".*\") or NIL; a list of named registers +defined in the REGEX; and a list of numbers denoting the registers referred to +by subpattern references in the REGEX." (declare #.*standard-optimize-settings*) ;; this function basically just initializes the special variables ;; and then calls CONVERT-AUX to do all the work @@ -960,4 +961,6 @@ or an EVERYTHING object \(if the regex starts with something like ;; we can't simply use *ALLOW-NAMED-REGISTERS* ;; since parse-tree syntax ignores it (when named-reg-seen - (nreverse reg-names))))) + (nreverse reg-names)) + (when numbered-subpattern-refs + (nreverse numbered-subpattern-refs))))) From 89107834f3750e969231ee2a4fc309554e53821b Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 28 Dec 2013 08:39:03 -0500 Subject: [PATCH 016/130] Create binding of special variable REFERENCED-REGISTER-MATCHERS-PLIST. --- api.lisp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api.lisp b/api.lisp index def03e5..b6fa828 100644 --- a/api.lisp +++ b/api.lisp @@ -105,6 +105,7 @@ modify its first argument \(but only if it's a parse tree).")) (let ((*syntax-error-string* nil)) (multiple-value-bind (regex reg-num starts-with reg-names subpattern-refs) (convert parse-tree) + (declare (special subpattern-refs)) ;; simplify REGEX by flattening nested SEQ and ALTERNATION ;; constructs and gathering STR objects (let ((regex (gather-strings (flatten regex)))) @@ -132,6 +133,9 @@ modify its first argument \(but only if it's a parse tree).")) ;; initialize the counters for CREATE-MATCHER-AUX (*rep-num* 0) (*zero-length-num* 0) + ;; keep track of the matcher functions of registers referenced by + ;; subpattern references + referenced-register-matchers-plist ;; create the actual matcher function (which does all the ;; work of matching the regular expression) corresponding ;; to REGEX and at the same time set the special @@ -148,7 +152,10 @@ modify its first argument \(but only if it's a parse tree).")) (create-bmh-matcher (str starts-with) (case-insensitive-p starts-with)))))) - (declare (special end-string-offset end-anchored-p end-string)) + (declare (special end-string-offset + end-anchored-p + end-string + referenced-register-matchers-plist)) ;; now create the scanner and return it (values (create-scanner-aux match-fn (regex-min-length regex) From eb3d9ec05a8b781e04f26456a379b4650116f6b2 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 29 Dec 2013 08:50:22 -0500 Subject: [PATCH 017/130] Define the closure that matches subpattern references, and modify the register closure. This required several things that may not have been necessary and will have to be revisited. First of all, for every register, we now create two inner matchers: one that matches the contents of the register and what follows the register, and one that only matches the contents of the register. Also, we now stop accumulating into STARTS-WITH once we encounter a register or subpattern reference. With this patch, subpattern references seem to work for the most part. They do not yet work with repetitions. --- api.lisp | 4 ++-- closures.lisp | 66 ++++++++++++++++++++++++++++++++++++--------------- convert.lisp | 21 ++++++++++++++-- optimize.lisp | 4 +++- 4 files changed, 71 insertions(+), 24 deletions(-) diff --git a/api.lisp b/api.lisp index b6fa828..115cf38 100644 --- a/api.lisp +++ b/api.lisp @@ -135,7 +135,7 @@ modify its first argument \(but only if it's a parse tree).")) (*zero-length-num* 0) ;; keep track of the matcher functions of registers referenced by ;; subpattern references - referenced-register-matchers-plist + (referenced-register-matchers (cons nil nil)) ;; create the actual matcher function (which does all the ;; work of matching the regular expression) corresponding ;; to REGEX and at the same time set the special @@ -155,7 +155,7 @@ modify its first argument \(but only if it's a parse tree).")) (declare (special end-string-offset end-anchored-p end-string - referenced-register-matchers-plist)) + referenced-register-matchers)) ;; now create the scanner and return it (values (create-scanner-aux match-fn (regex-min-length regex) diff --git a/closures.lisp b/closures.lisp index a275078..609988a 100644 --- a/closures.lisp +++ b/closures.lisp @@ -86,6 +86,7 @@ such that the call to NEXT-FN after the match would succeed.")) (defmethod create-matcher-aux ((register register) next-fn) (declare #.*standard-optimize-settings*) + (declare (special subpattern-refs referenced-register-matchers)) ;; the position of this REGISTER within the whole regex; we start to ;; count at 0 (let ((num (num register))) @@ -101,27 +102,40 @@ such that the call to NEXT-FN after the match would succeed.")) (funcall next-fn start-pos))) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER + ;; FIXME: We make two matchers here, one for matching within the register + ;; itself, and the other for matching a subpattern reference referring to + ;; this register. This is far from ideal and probably not necessary. At + ;; the very least, we should only create the latter matcher when we know + ;; this register is to be referenced. (let ((inner-matcher (create-matcher-aux (regex register) - #'store-end-of-reg))) - (declare (function inner-matcher)) + #'store-end-of-reg)) + (inner-matcher-without-next-fn (create-matcher-aux + (regex register) + #'identity))) + (declare (function inner-matcher inner-matcher-without-next-fn)) ;; here comes the actual closure for REGISTER - (lambda (start-pos) - (declare (fixnum start-pos)) - ;; remember the old values of *REGS-START* and friends in - ;; case we cannot match - (let ((old-*reg-starts* (svref *reg-starts* num)) - (old-*regs-maybe-start* (svref *regs-maybe-start* num)) - (old-*reg-ends* (svref *reg-ends* num))) - ;; we cannot use *REGS-START* here because Perl allows - ;; regular expressions like /(a|\1x)*/ - (setf (svref *regs-maybe-start* num) start-pos) - (let ((next-pos (funcall inner-matcher start-pos))) - (unless next-pos - ;; restore old values on failure - (setf (svref *reg-starts* num) old-*reg-starts* - (svref *regs-maybe-start* num) old-*regs-maybe-start* - (svref *reg-ends* num) old-*reg-ends*)) - next-pos))))))) + (setf (getf (car referenced-register-matchers) num) + (lambda (start-pos &optional other-fn) + (declare (fixnum start-pos)) + (if other-fn + (let ((next-pos (funcall inner-matcher-without-next-fn start-pos))) + (when next-pos + (funcall (the function other-fn) next-pos))) + ;; remember the old values of *REGS-START* and friends in + ;; case we cannot match + (let ((old-*reg-starts* (svref *reg-starts* num)) + (old-*regs-maybe-start* (svref *regs-maybe-start* num)) + (old-*reg-ends* (svref *reg-ends* num))) + ;; we cannot use *REGS-START* here because Perl allows + ;; regular expressions like /(a|\1x)*/ + (setf (svref *regs-maybe-start* num) start-pos) + (let ((next-pos (funcall inner-matcher start-pos))) + (unless next-pos + ;; restore old values on failure + (setf (svref *reg-starts* num) old-*reg-starts* + (svref *regs-maybe-start* num) old-*regs-maybe-start* + (svref *reg-ends* num) old-*reg-ends*)) + next-pos))))))))) (defmethod create-matcher-aux ((lookahead lookahead) next-fn) (declare #.*standard-optimize-settings*) @@ -427,6 +441,20 @@ against CHR-EXPR." reg-start reg-end) (funcall next-fn next-pos))))))))) +(defmethod create-matcher-aux ((subpattern-reference subpattern-reference) next-fn) + (declare #.*standard-optimize-settings*) + (declare (function next-fn) (special referenced-register-matchers)) + ;; We have to close over the special variable REFERENCED-REGISTER-MATCHERS in + ;; order to reference it during the match phase. + ;; FIXME: In the case of forward subpattern references at least, we should be + ;; able to get at the register matcher during the matcher construction phase. + (let ((num (num subpattern-reference)) + (referenced-register-matchers referenced-register-matchers)) + (declare (fixnum num)) + (lambda (start-pos) + (let ((subpattern-matcher (getf (car referenced-register-matchers) (1- num)))) + (funcall (the function subpattern-matcher) start-pos next-fn))))) + (defmethod create-matcher-aux ((branch branch) next-fn) (declare #.*standard-optimize-settings*) (let* ((test (test branch)) diff --git a/convert.lisp b/convert.lisp index b7c9e8b..11aa169 100644 --- a/convert.lisp +++ b/convert.lisp @@ -581,7 +581,7 @@ called with GREEDYP set to NIL as you would expect." "The case for \(:REGISTER ). Also used for named registers when NAME is not NIL." (declare #.*standard-optimize-settings*) - (declare (special flags reg-num reg-names)) + (declare (special flags reg-num reg-names accumulate-start-p)) ;; keep the effect of modifiers local to the enclosed regex; also, ;; assign the current value of REG-NUM to the corresponding slot of ;; the REGISTER object and increase this counter afterwards; for @@ -594,6 +594,16 @@ when NAME is not NIL." (when name (setq named-reg-seen t)) (incf (the fixnum reg-num)) (push name reg-names) + ;; FIXME: While inside registers, we cannot indiscriminately accumulate into + ;; the special variable STARTS-WITH because recursive subpattern references + ;; might cause too much of the string to be skipped or endless recursion, as + ;; with: + ;; (scan "(\\([^()]*(?:(?1)|\\))\\))" "(())") + ;; For now, we set ACCUMULATE-START-P to NIL, but it may be possible to + ;; determine which registers are referenced--either now or at the matcher + ;; generation phase--and not needlessly throw away information that may be + ;; helpful in optimization. + (setq accumulate-start-p nil) (make-instance 'register :regex (convert-aux (if name (third parse-tree) (second parse-tree))) :num stored-reg-num @@ -678,7 +688,14 @@ when NAME is not NIL." (defmethod convert-compound-parse-tree ((token (eql :subpattern-reference)) parse-tree &key) "The case for parse trees like \(:SUBPATTERN-REFERENCE |)." (declare #.*standard-optimize-settings*) - (declare (special max-subpattern-ref numbered-subpattern-refs named-subpattern-refs)) + (declare (special max-subpattern-ref + numbered-subpattern-refs + named-subpattern-refs + accumulate-start-p)) + ;; stop accumulating into STARTS-WITH + ;; FIXME: It may be possible to continue accumulating under certain + ;; circumstatnces. + (setq accumulate-start-p nil) ;; Subpattern references may refer to registers that come later in the regex, ;; so we don't validate the subpattern name/number until the entire object has ;; been constructed. diff --git a/optimize.lisp b/optimize.lisp index d538733..e317c5d 100644 --- a/optimize.lisp +++ b/optimize.lisp @@ -486,7 +486,9 @@ function called by END-STRING.)")) :case-insensitive-p :void)) (t ;; (ALTERNATION, BACK-REFERENCE, BRANCH, CHAR-CLASS, EVERYTHING, - ;; REPETITION, FILTER) + ;; REPETITION, FILTER, SUBPATTERN-REFERENCE) + ;; FIXME: Can we determine constant string ending in the case of + ;; SUBPATTERN-REFERENCE? nil))) (defun end-string (regex) From ce1b0fead2fdbe0b0cf7ef6f899d9ee1b9690e67 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 29 Dec 2013 10:12:36 -0500 Subject: [PATCH 018/130] Define REGEX-LENGTH on SUBPATTERN-REFERENCE. --- regex-class-util.lisp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/regex-class-util.lisp b/regex-class-util.lisp index b737378..0d042db 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -374,6 +374,13 @@ to this object, otherwise NIL. So, \"(.){1}\" would return true ;; with enough effort we could possibly do better here, but ;; currently we just give up and return NIL nil) + +(defmethod regex-length ((subpattern-reference subpattern-reference)) + (declare #.*standard-optimize-settings*) + ;; with enough effort we could possibly do better here, but + ;; currently we just give up and return NIL + ;; FIXME + nil) (defmethod regex-length ((char-class char-class)) (declare #.*standard-optimize-settings*) @@ -456,7 +463,8 @@ to this object, otherwise NIL. So, \"(.){1}\" would return true (defmethod regex-min-length ((regex regex)) (declare #.*standard-optimize-settings*) ;; the general case for ANCHOR, BACK-REFERENCE, LOOKAHEAD, - ;; LOOKBEHIND, VOID, and WORD-BOUNDARY + ;; LOOKBEHIND, SUBPATTERN-REFERENCE, VOID, and WORD-BOUNDARY + ;; FIXME: Compute SUBPATTERN-REFERENCE minimum length. 0) (defgeneric compute-offsets (regex start-pos) From 972dba547e2e85326c62c9f278cd4a322af2d20a Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 29 Dec 2013 10:32:37 -0500 Subject: [PATCH 019/130] Define COPY-REGEX and COMPUTE-OFFSETS on SUBPATTERN-REFERENCE. At this point, one thing that doesn't work quite right is the determination of register offsets for registers accessed indirectly by subpattern references. For example: (cl-ppcre:scan "(\\([^()]*((?1)\\)|\\)))" "((()))") says that the second register is at position (3, 6), though it should be (1, 6). Fixing this will require binding a special variable from subpattern reference closures that tells register closures not to touch the register offsets. --- optimize.lisp | 18 +++++++++--------- regex-class-util.lisp | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/optimize.lisp b/optimize.lisp index e317c5d..c4fb0c4 100644 --- a/optimize.lisp +++ b/optimize.lisp @@ -119,9 +119,9 @@ operation on REGEX.")) (flatten (regex regex))) regex) (t - ;; otherwise (ANCHOR, BACK-REFERENCE, CHAR-CLASS, EVERYTHING, - ;; LOOKAHEAD, LOOKBEHIND, STR, VOID, FILTER, and WORD-BOUNDARY) - ;; do nothing + ;; otherwise (ANCHOR, BACK-REFERENCE, SUBPATTERN-REFERENCE, CHAR-CLASS, + ;; EVERYTHING, LOOKAHEAD, LOOKBEHIND, STR, VOID, FILTER, and + ;; WORD-BOUNDARY) do nothing regex))) (defgeneric gather-strings (regex) @@ -278,9 +278,9 @@ operation on REGEX.")) (gather-strings (regex regex))) regex) (t - ;; otherwise (ANCHOR, BACK-REFERENCE, CHAR-CLASS, EVERYTHING, - ;; LOOKAHEAD, LOOKBEHIND, STR, VOID, FILTER, and WORD-BOUNDARY) - ;; do nothing + ;; otherwise (ANCHOR, BACK-REFERENCE, SUBPATTERN-REFERENCE, CHAR-CLASS, + ;; EVERYTHING, LOOKAHEAD, LOOKBEHIND, STR, VOID, FILTER, and + ;; WORD-BOUNDARY) do nothing regex))) ;; Note that START-ANCHORED-P will be called after FLATTEN and GATHER-STRINGS. @@ -356,7 +356,7 @@ zero-length assertion.")) :zero-length nil)) (t - ;; BACK-REFERENCE, CHAR-CLASS, EVERYTHING, and STR + ;; BACK-REFERENCE, SUBPATTERN-REFERENCE, CHAR-CLASS, EVERYTHING, and STR nil))) ;; Note that END-STRING-AUX will be called after FLATTEN and GATHER-STRINGS. @@ -575,6 +575,6 @@ objects.")) ((or char-class everything) (1+ current-min-rest)) (t - ;; zero min-len and no embedded regexes (ANCHOR, - ;; BACK-REFERENCE, VOID, and WORD-BOUNDARY) + ;; zero min-len and no embedded regexes (ANCHOR, BACK-REFERENCE, + ;; SUBPATTERN-REFERENCE, VOID, and WORD-BOUNDARY) current-min-rest))) diff --git a/regex-class-util.lisp b/regex-class-util.lisp index 0d042db..e6ae7af 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -159,6 +159,12 @@ which are not of type STR.")) :num (num back-reference) :case-insensitive-p (case-insensitive-p back-reference))) +(defmethod copy-regex ((subpattern-reference subpattern-reference)) + (declare #.*standard-optimize-settings*) + (make-instance 'subpattern-reference + :num (num subpattern-reference) + :name (name subpattern-reference))) + (defmethod copy-regex ((char-class char-class)) (declare #.*standard-optimize-settings*) (make-instance 'char-class @@ -312,8 +318,8 @@ to this object, otherwise NIL. So, \"(.){1}\" would return true (defmethod everythingp ((regex regex)) (declare #.*standard-optimize-settings*) - ;; the general case for ANCHOR, BACK-REFERENCE, BRANCH, CHAR-CLASS, - ;; LOOKAHEAD, LOOKBEHIND, STR, VOID, FILTER, and WORD-BOUNDARY + ;; the general case for ANCHOR, BACK-REFERENCE, SUBPATTERN-REFERENCE, BRANCH, + ;; CHAR-CLASS, LOOKAHEAD, LOOKBEHIND, STR, VOID, FILTER, and WORD-BOUNDARY nil) (defgeneric regex-length (regex) @@ -549,6 +555,12 @@ slots of STR objects further down the tree.")) (declare (ignore start-pos)) nil) +(defmethod compute-offsets ((subpattern-reference subpattern-reference) start-pos) + (declare #.*standard-optimize-settings*) + (declare (ignore start-pos)) + ;; FIXME: Not sure what this does... + nil) + (defmethod compute-offsets ((filter filter) start-pos) (declare #.*standard-optimize-settings*) (let ((len (len filter))) From b7ab328e3dca2885a3e2539e8fb8dedbfcc5da8b Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 29 Dec 2013 16:33:47 -0500 Subject: [PATCH 020/130] Be sure not to touch register offsets when matching a register indirectly from a subpattern reference. With this patch, the following invocation: (cl-ppcre:scan "(\\([^()]*((?1)\\)|\\)))" "((()))") gives the correct offset values for the second register as (1,6). One problem that remains is the danger of infinite recursion during backtracking. The following invocation: (cl-ppcre:scan "(?1)(?2)(a|b|(?1))(c)" "acba") causes a stack overflow because the second (?1) is called endlessly during backtracking without the match position advancing through the string. Such behavior may be able to be remedied by having the subpattern reference's closure keep track of where in *STRING* it has been called before. --- closures.lisp | 54 +++++++++++++++++++++++++++++++-------------------- scanner.lisp | 4 +++- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/closures.lisp b/closures.lisp index 609988a..07bdeba 100644 --- a/closures.lisp +++ b/closures.lisp @@ -86,7 +86,9 @@ such that the call to NEXT-FN after the match would succeed.")) (defmethod create-matcher-aux ((register register) next-fn) (declare #.*standard-optimize-settings*) - (declare (special subpattern-refs referenced-register-matchers)) + (declare (special subpattern-refs + referenced-register-matchers + inside-subpattern-reference)) ;; the position of this REGISTER within the whole regex; we start to ;; count at 0 (let ((num (num register))) @@ -97,8 +99,9 @@ such that the call to NEXT-FN after the match would succeed.")) (flet ((store-end-of-reg (start-pos) (declare (fixnum start-pos) (function next-fn)) - (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) - (svref *reg-ends* num) start-pos) + (unless inside-subpattern-reference + (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) + (svref *reg-ends* num) start-pos)) (funcall next-fn start-pos))) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER @@ -121,21 +124,25 @@ such that the call to NEXT-FN after the match would succeed.")) (let ((next-pos (funcall inner-matcher-without-next-fn start-pos))) (when next-pos (funcall (the function other-fn) next-pos))) - ;; remember the old values of *REGS-START* and friends in - ;; case we cannot match - (let ((old-*reg-starts* (svref *reg-starts* num)) - (old-*regs-maybe-start* (svref *regs-maybe-start* num)) - (old-*reg-ends* (svref *reg-ends* num))) - ;; we cannot use *REGS-START* here because Perl allows - ;; regular expressions like /(a|\1x)*/ - (setf (svref *regs-maybe-start* num) start-pos) - (let ((next-pos (funcall inner-matcher start-pos))) - (unless next-pos - ;; restore old values on failure - (setf (svref *reg-starts* num) old-*reg-starts* - (svref *regs-maybe-start* num) old-*regs-maybe-start* - (svref *reg-ends* num) old-*reg-ends*)) - next-pos))))))))) + (if inside-subpattern-reference + ;; Don't touch the register offsets if we've come to a + ;; register from within a subpattern reference. + (funcall inner-matcher start-pos) + ;; remember the old values of *REGS-START* and friends in + ;; case we cannot match + (let ((old-*reg-starts* (svref *reg-starts* num)) + (old-*regs-maybe-start* (svref *regs-maybe-start* num)) + (old-*reg-ends* (svref *reg-ends* num))) + ;; we cannot use *REGS-START* here because Perl allows + ;; regular expressions like /(a|\1x)*/ + (setf (svref *regs-maybe-start* num) start-pos) + (let ((next-pos (funcall inner-matcher start-pos))) + (unless next-pos + ;; restore old values on failure + (setf (svref *reg-starts* num) old-*reg-starts* + (svref *regs-maybe-start* num) old-*regs-maybe-start* + (svref *reg-ends* num) old-*reg-ends*)) + next-pos)))))))))) (defmethod create-matcher-aux ((lookahead lookahead) next-fn) (declare #.*standard-optimize-settings*) @@ -443,16 +450,21 @@ against CHR-EXPR." (defmethod create-matcher-aux ((subpattern-reference subpattern-reference) next-fn) (declare #.*standard-optimize-settings*) - (declare (function next-fn) (special referenced-register-matchers)) + (declare (special referenced-register-matchers inside-subpattern-reference) + (function next-fn)) ;; We have to close over the special variable REFERENCED-REGISTER-MATCHERS in ;; order to reference it during the match phase. ;; FIXME: In the case of forward subpattern references at least, we should be ;; able to get at the register matcher during the matcher construction phase. (let ((num (num subpattern-reference)) - (referenced-register-matchers referenced-register-matchers)) - (declare (fixnum num)) + (referenced-register-matchers referenced-register-matchers) + (next-fn (lambda (start-pos) + (setq inside-subpattern-reference nil) + (funcall next-fn start-pos)))) + (declare (fixnum num) (function next-fn)) (lambda (start-pos) (let ((subpattern-matcher (getf (car referenced-register-matchers) (1- num)))) + (setq inside-subpattern-reference t) (funcall (the function subpattern-matcher) start-pos next-fn))))) (defmethod create-matcher-aux ((branch branch) next-fn) diff --git a/scanner.lisp b/scanner.lisp index ea43443..a2f98ab 100644 --- a/scanner.lisp +++ b/scanner.lisp @@ -157,8 +157,10 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX." (str starts-with) nil)) ;; we don't need to try further than MAX-END-POS - (max-end-pos (- *end-pos* min-len))) + (max-end-pos (- *end-pos* min-len)) + inside-subpattern-reference) (declare (fixnum scan-start-pos) + (special inside-subpattern-reference) (function match-fn)) ;; definition of ADVANCE-FN will be inserted here by macrology (labels ((advance-fn-definition)) From 69f0d7c0244234b79bb1b78d819291eeae0ae46b Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 29 Dec 2013 16:57:11 -0500 Subject: [PATCH 021/130] Don't backtrack through subpattern references ad infinitum. This is going to be reverted immediately, since apparently Perl isn't smart enough to do this and will itself overflow the stack. --- closures.lisp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/closures.lisp b/closures.lisp index 07bdeba..f12089c 100644 --- a/closures.lisp +++ b/closures.lisp @@ -458,14 +458,28 @@ against CHR-EXPR." ;; able to get at the register matcher during the matcher construction phase. (let ((num (num subpattern-reference)) (referenced-register-matchers referenced-register-matchers) + ;; Wrap NEXT-FN in order to set INSIDE-SUBPATTERN-REFERENCE to NIL + ;; before proceeding. (next-fn (lambda (start-pos) (setq inside-subpattern-reference nil) - (funcall next-fn start-pos)))) - (declare (fixnum num) (function next-fn)) + (funcall next-fn start-pos))) + seen) + (declare (fixnum num) (function next-fn) (type list seen)) (lambda (start-pos) - (let ((subpattern-matcher (getf (car referenced-register-matchers) (1- num)))) - (setq inside-subpattern-reference t) - (funcall (the function subpattern-matcher) start-pos next-fn))))) + (declare (fixnum start-pos)) + (if (member start-pos seen :test #'=) + ;; We've been here before. Return NIL so as to avoid infinite + ;; backtracking/recursion, as would otherwise happen with, e.g.: + ;; (cl-ppcre:scan "(?1)(?2)(a|b|(?1))(c)" "acba") + ;; FIXME: The logic of this may be defective. Is it possible for this + ;; closure to be called at the same place more than once and still + ;; succeed? + nil + (let ((subpattern-matcher (getf (car referenced-register-matchers) + (1- num)))) + (push start-pos seen) + (setq inside-subpattern-reference t) + (funcall (the function subpattern-matcher) start-pos next-fn)))))) (defmethod create-matcher-aux ((branch branch) next-fn) (declare #.*standard-optimize-settings*) From 55a48e0bc703cf841b950768aeffe8c4a90427e5 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 29 Dec 2013 16:58:59 -0500 Subject: [PATCH 022/130] Revert "Don't backtrack through subpattern references ad infinitum." This reverts commit 69f0d7c0244234b79bb1b78d819291eeae0ae46b. --- closures.lisp | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/closures.lisp b/closures.lisp index f12089c..07bdeba 100644 --- a/closures.lisp +++ b/closures.lisp @@ -458,28 +458,14 @@ against CHR-EXPR." ;; able to get at the register matcher during the matcher construction phase. (let ((num (num subpattern-reference)) (referenced-register-matchers referenced-register-matchers) - ;; Wrap NEXT-FN in order to set INSIDE-SUBPATTERN-REFERENCE to NIL - ;; before proceeding. (next-fn (lambda (start-pos) (setq inside-subpattern-reference nil) - (funcall next-fn start-pos))) - seen) - (declare (fixnum num) (function next-fn) (type list seen)) + (funcall next-fn start-pos)))) + (declare (fixnum num) (function next-fn)) (lambda (start-pos) - (declare (fixnum start-pos)) - (if (member start-pos seen :test #'=) - ;; We've been here before. Return NIL so as to avoid infinite - ;; backtracking/recursion, as would otherwise happen with, e.g.: - ;; (cl-ppcre:scan "(?1)(?2)(a|b|(?1))(c)" "acba") - ;; FIXME: The logic of this may be defective. Is it possible for this - ;; closure to be called at the same place more than once and still - ;; succeed? - nil - (let ((subpattern-matcher (getf (car referenced-register-matchers) - (1- num)))) - (push start-pos seen) - (setq inside-subpattern-reference t) - (funcall (the function subpattern-matcher) start-pos next-fn)))))) + (let ((subpattern-matcher (getf (car referenced-register-matchers) (1- num)))) + (setq inside-subpattern-reference t) + (funcall (the function subpattern-matcher) start-pos next-fn))))) (defmethod create-matcher-aux ((branch branch) next-fn) (declare #.*standard-optimize-settings*) From 38986bdb907891e2a23088e15b240dfdb521822a Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 2 Jan 2014 15:33:37 -0500 Subject: [PATCH 023/130] Use COND instead of multi-branch IF. --- closures.lisp | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/closures.lisp b/closures.lisp index 07bdeba..83463a0 100644 --- a/closures.lisp +++ b/closures.lisp @@ -120,29 +120,31 @@ such that the call to NEXT-FN after the match would succeed.")) (setf (getf (car referenced-register-matchers) num) (lambda (start-pos &optional other-fn) (declare (fixnum start-pos)) - (if other-fn - (let ((next-pos (funcall inner-matcher-without-next-fn start-pos))) - (when next-pos - (funcall (the function other-fn) next-pos))) - (if inside-subpattern-reference - ;; Don't touch the register offsets if we've come to a - ;; register from within a subpattern reference. - (funcall inner-matcher start-pos) - ;; remember the old values of *REGS-START* and friends in - ;; case we cannot match - (let ((old-*reg-starts* (svref *reg-starts* num)) - (old-*regs-maybe-start* (svref *regs-maybe-start* num)) - (old-*reg-ends* (svref *reg-ends* num))) - ;; we cannot use *REGS-START* here because Perl allows - ;; regular expressions like /(a|\1x)*/ - (setf (svref *regs-maybe-start* num) start-pos) - (let ((next-pos (funcall inner-matcher start-pos))) - (unless next-pos - ;; restore old values on failure - (setf (svref *reg-starts* num) old-*reg-starts* - (svref *regs-maybe-start* num) old-*regs-maybe-start* - (svref *reg-ends* num) old-*reg-ends*)) - next-pos)))))))))) + (cond + (other-fn + (let ((next-pos (funcall inner-matcher-without-next-fn start-pos))) + (when next-pos + (funcall (the function other-fn) next-pos)))) + (inside-subpattern-reference + ;; Don't touch the register offsets if we've come to a + ;; register from within a subpattern reference. + (funcall inner-matcher start-pos)) + (t + ;; remember the old values of *REGS-START* and friends in + ;; case we cannot match + (let ((old-*reg-starts* (svref *reg-starts* num)) + (old-*regs-maybe-start* (svref *regs-maybe-start* num)) + (old-*reg-ends* (svref *reg-ends* num))) + ;; we cannot use *REGS-START* here because Perl allows + ;; regular expressions like /(a|\1x)*/ + (setf (svref *regs-maybe-start* num) start-pos) + (let ((next-pos (funcall inner-matcher start-pos))) + (unless next-pos + ;; restore old values on failure + (setf (svref *reg-starts* num) old-*reg-starts* + (svref *regs-maybe-start* num) old-*regs-maybe-start* + (svref *reg-ends* num) old-*reg-ends*)) + next-pos)))))))))) (defmethod create-matcher-aux ((lookahead lookahead) next-fn) (declare #.*standard-optimize-settings*) From 5de75658bbef2daed521360feb3df15669d3c781 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 6 Jan 2014 16:17:47 -0500 Subject: [PATCH 024/130] Add tests for subpattern references. 1634 and 1635 currently don't work. --- test/perltestdata | 7 +++++++ test/perltestinput | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index 1b52320..cefdc2f 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14290,3 +14290,10 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1627 "\"aaaaaaaaaa\" =~ /((a{0,5}){0,5}){0,5}c/" "((a{0,5}){0,5}){0,5}c" nil nil nil nil "aaaaaaaaaa" nil nil nil) (1628 "\"aaaaaaaaaac\" =~ /((a{0,5}){0,5})*c/" "((a{0,5}){0,5})*c" nil nil nil nil "aaaaaaaaaac" nil "aaaaaaaaaac" ("" "" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1629 "\"aaaaaaaaaa\" =~ /((a{0,5}){0,5})*c/" "((a{0,5}){0,5})*c" nil nil nil nil "aaaaaaaaaa" nil nil nil) +(1630 "\"abd\" =~ /^(?=(?1))?[az]([abc])d/" "^(?=(?1))?[az]([abc])d" nil nil nil nil "abd" nil "abd" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1631 "\"zcdxx\" =~ /^(?=(?1))?[az]([abc])d/" "^(?=(?1))?[az]([abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1632 "\"abcabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1633 "\"xyzabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1634 "\"XYabcdY\" =~ /^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/" "^X(?5)(a)(?:(b)|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1635 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1636 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) diff --git a/test/perltestinput b/test/perltestinput index 1425493..a3b7027 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -3954,3 +3954,20 @@ /((a{0,5}){0,5})*c/ aaaaaaaaaac aaaaaaaaaa + +/^(?=(?1))?[az]([abc])d/ + abd + zcdxx + +/(?:(abc)|(xyz))(?1)/ + abcabc + xyzabc + +/^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/ + XYabcdY + +/^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)/ + XYabcdY + +/^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)/ + XYabcdY From fa60aff7600c2780c0fa00bfc5f2890231318258 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 6 Jan 2014 17:04:35 -0500 Subject: [PATCH 025/130] Remove unused variable declaration. --- closures.lisp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/closures.lisp b/closures.lisp index 83463a0..a3ef2e0 100644 --- a/closures.lisp +++ b/closures.lisp @@ -86,8 +86,7 @@ such that the call to NEXT-FN after the match would succeed.")) (defmethod create-matcher-aux ((register register) next-fn) (declare #.*standard-optimize-settings*) - (declare (special subpattern-refs - referenced-register-matchers + (declare (special referenced-register-matchers inside-subpattern-reference)) ;; the position of this REGISTER within the whole regex; we start to ;; count at 0 From 09625d5fe9836e6a37758a15d2c3fe3286debcfc Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 6 Jan 2014 17:23:39 -0500 Subject: [PATCH 026/130] Skip end of string optimizations with subpattern references. --- optimize.lisp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/optimize.lisp b/optimize.lisp index c4fb0c4..0df2b9d 100644 --- a/optimize.lisp +++ b/optimize.lisp @@ -372,8 +372,12 @@ function called by END-STRING.)")) (defmethod end-string-aux ((str str) &optional (old-case-insensitive-p :void)) (declare #.*standard-optimize-settings*) - (declare (special last-str)) - (cond ((and (not (skip str)) ; avoid constituents of STARTS-WITH + (declare (special last-str subpattern-refs)) + ;; FIXME: Skip this optimization when we have subpattern references. This may + ;; still be possible if we know about the context of this string, such as + ;; which register(s) it falls within. + (cond ((and (null subpattern-refs) + (not (skip str)) ; avoid constituents of STARTS-WITH ;; only use STR if nothing has been collected yet or if ;; the collected string has the same value for ;; CASE-INSENSITIVE-P From a4e1eaad9bb29e1ba6a27ed2b7414ad459a4619e Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 6 Jan 2014 17:45:56 -0500 Subject: [PATCH 027/130] Actually, only skip the "skip" optimization when optimizing ends of strings in patterns containing subpattern references. --- optimize.lisp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/optimize.lisp b/optimize.lisp index 0df2b9d..eabe8f2 100644 --- a/optimize.lisp +++ b/optimize.lisp @@ -373,20 +373,20 @@ function called by END-STRING.)")) &optional (old-case-insensitive-p :void)) (declare #.*standard-optimize-settings*) (declare (special last-str subpattern-refs)) - ;; FIXME: Skip this optimization when we have subpattern references. This may - ;; still be possible if we know about the context of this string, such as - ;; which register(s) it falls within. - (cond ((and (null subpattern-refs) - (not (skip str)) ; avoid constituents of STARTS-WITH + (cond ((and (not (skip str)) ; avoid constituents of STARTS-WITH ;; only use STR if nothing has been collected yet or if ;; the collected string has the same value for ;; CASE-INSENSITIVE-P (or (eq old-case-insensitive-p :void) (eq (case-insensitive-p str) old-case-insensitive-p))) - (setf last-str str - ;; set the SKIP property of this STR - (skip str) t) - str) + ;; set the SKIP property of this STR + (setf last-str str) + ;; FIXME: Only apply this optimization when we don't have subpattern + ;; references. This may still be possible if we know about the context + ;; of this string, such as which register(s) it falls within. + (when (null subpattern-refs) + (setf (skip str) t)) + str) (t nil))) (defmethod end-string-aux ((seq seq) From e100f55a759ea3c6d5834f001d927d747e1d9a32 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 6 Jan 2014 17:59:55 -0500 Subject: [PATCH 028/130] Add forgotten type to ETYPECASE expression. --- convert.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert.lisp b/convert.lisp index 5037104..9dfc144 100644 --- a/convert.lisp +++ b/convert.lisp @@ -921,7 +921,7 @@ parse trees which are atoms.") (branch (mapc #'convert-named-subpattern-refs (list (then-regex converted-tree) (else-regex converted-tree)))) - ((or str void)))) + ((or str char-class void)))) (defun convert (parse-tree) "Converts the parse tree PARSE-TREE into an equivalent REGEX object and From ada178ad42d99a0c8580177e0e58060fc265e7c4 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 6 Jan 2014 18:00:21 -0500 Subject: [PATCH 029/130] Add more tests for subpattern references. Current, the following tests fail: 1638, 1639, 1641, 1642, 1643, 1644, 1645, 1646. --- test/perltestdata | 15 +++++++++++++++ test/perltestinput | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index cefdc2f..87511c5 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14297,3 +14297,18 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1634 "\"XYabcdY\" =~ /^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/" "^X(?5)(a)(?:(b)|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) (1635 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) (1636 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1637 "\"abc\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1638 "\"a(b)c\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1639 "\"a(b(c))d\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1640 "\">abc>123abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>123abc>123abc>1(2)3abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>(1(2)3)abc>(1(2)3)abc>([^()]|\((?1)*\))*abc>123abc>1(2)3abc>(1(2)3) Date: Mon, 6 Jan 2014 18:57:26 -0500 Subject: [PATCH 030/130] Use SETF instead of SETQ. --- closures.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/closures.lisp b/closures.lisp index a3ef2e0..f51dba9 100644 --- a/closures.lisp +++ b/closures.lisp @@ -460,12 +460,13 @@ against CHR-EXPR." (let ((num (num subpattern-reference)) (referenced-register-matchers referenced-register-matchers) (next-fn (lambda (start-pos) - (setq inside-subpattern-reference nil) + (break) + (setf inside-subpattern-reference nil) (funcall next-fn start-pos)))) (declare (fixnum num) (function next-fn)) (lambda (start-pos) (let ((subpattern-matcher (getf (car referenced-register-matchers) (1- num)))) - (setq inside-subpattern-reference t) + (setf inside-subpattern-reference t) (funcall (the function subpattern-matcher) start-pos next-fn))))) (defmethod create-matcher-aux ((branch branch) next-fn) From 0309c76f073210689d2b0b62de807762a0586558 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 6 Jan 2014 19:25:27 -0500 Subject: [PATCH 031/130] Make sure INSIDE-SUBPATTERN-REFERENCE gets set to NIL when NEXT-FN is not called. The NEXT-FN (or OTHER-FN) parameter is only called when the register's inner matcher succeeds. When the inner matcher failed, INSIDE-SUBPATTERN-REFERENCE was not being unset, though it should have been. --- closures.lisp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/closures.lisp b/closures.lisp index f51dba9..0fcd34f 100644 --- a/closures.lisp +++ b/closures.lisp @@ -121,7 +121,13 @@ such that the call to NEXT-FN after the match would succeed.")) (declare (fixnum start-pos)) (cond (other-fn - (let ((next-pos (funcall inner-matcher-without-next-fn start-pos))) + ;; The presence of OTHER-FN indicates we have been called by a + ;; subpattern reference closure. Bind INSIDE-SUBPATTERN-REFERENCE + ;; and call the matcher for this register's regex. + (let ((next-pos + (let ((inside-subpattern-reference t)) + (declare (special inside-subpattern-reference)) + (funcall inner-matcher-without-next-fn start-pos)))) (when next-pos (funcall (the function other-fn) next-pos)))) (inside-subpattern-reference @@ -451,22 +457,17 @@ against CHR-EXPR." (defmethod create-matcher-aux ((subpattern-reference subpattern-reference) next-fn) (declare #.*standard-optimize-settings*) - (declare (special referenced-register-matchers inside-subpattern-reference) + (declare (special referenced-register-matchers) (function next-fn)) ;; We have to close over the special variable REFERENCED-REGISTER-MATCHERS in ;; order to reference it during the match phase. ;; FIXME: In the case of forward subpattern references at least, we should be ;; able to get at the register matcher during the matcher construction phase. (let ((num (num subpattern-reference)) - (referenced-register-matchers referenced-register-matchers) - (next-fn (lambda (start-pos) - (break) - (setf inside-subpattern-reference nil) - (funcall next-fn start-pos)))) + (referenced-register-matchers referenced-register-matchers)) (declare (fixnum num) (function next-fn)) (lambda (start-pos) (let ((subpattern-matcher (getf (car referenced-register-matchers) (1- num)))) - (setf inside-subpattern-reference t) (funcall (the function subpattern-matcher) start-pos next-fn))))) (defmethod create-matcher-aux ((branch branch) next-fn) From 806857a8e977f3bc563da7a7344f1f30180ff895 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 6 Jan 2014 20:36:07 -0500 Subject: [PATCH 032/130] Number tests correctly. --- test/perltestdata | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/perltestdata b/test/perltestdata index 87511c5..291f5d5 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14306,9 +14306,9 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1643 "\"1221\" =~ /^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$/i" "^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1644 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$/i" "^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S" nil nil nil nil nil nil nil nil nil nil nil nil)) (1645 "\"AmanaplanacanalPanama\" =~ /^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$/i" "^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1645 "\"AblewasIereIsawElba\" =~ /^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$/i" "^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1646 "\"12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1647 "\"(((2+2)*-3)-7)\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1647 "\"-12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1648 "\"xyz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1649 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1646 "\"AblewasIereIsawElba\" =~ /^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$/i" "^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1647 "\"12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1648 "\"(((2+2)*-3)-7)\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1649 "\"-12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1650 "\"xyz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1651 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) From 047c17e5353bb5181dfedd9ada432f3676108f38 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 6 Jan 2014 20:39:16 -0500 Subject: [PATCH 033/130] Create a temporary set of registers for each pass through a subpattern reference. This patch fixes tests 1643-1646. --- closures.lisp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/closures.lisp b/closures.lisp index 0fcd34f..0650e7b 100644 --- a/closures.lisp +++ b/closures.lisp @@ -98,9 +98,8 @@ such that the call to NEXT-FN after the match would succeed.")) (flet ((store-end-of-reg (start-pos) (declare (fixnum start-pos) (function next-fn)) - (unless inside-subpattern-reference - (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) - (svref *reg-ends* num) start-pos)) + (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) + (svref *reg-ends* num) start-pos) (funcall next-fn start-pos))) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER @@ -125,15 +124,20 @@ such that the call to NEXT-FN after the match would succeed.")) ;; subpattern reference closure. Bind INSIDE-SUBPATTERN-REFERENCE ;; and call the matcher for this register's regex. (let ((next-pos - (let ((inside-subpattern-reference t)) + (let* ((inside-subpattern-reference t) + ;; Create a new temporary set of registers for + ;; matching back references while inside a + ;; subpattern reference, as with Perl. Cf. tests + ;; 1643-1646. + (reg-num (array-dimension *reg-starts* 0)) + (*reg-starts* (make-array reg-num :initial-element nil)) + (*regs-maybe-start* (make-array reg-num :initial-element nil)) + (*reg-ends* (make-array reg-num :initial-element nil))) (declare (special inside-subpattern-reference)) + (setf (svref *regs-maybe-start* num) start-pos) (funcall inner-matcher-without-next-fn start-pos)))) (when next-pos (funcall (the function other-fn) next-pos)))) - (inside-subpattern-reference - ;; Don't touch the register offsets if we've come to a - ;; register from within a subpattern reference. - (funcall inner-matcher start-pos)) (t ;; remember the old values of *REGS-START* and friends in ;; case we cannot match From 22c26a8262f71491351c626b764db88b88a853c5 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 7 Jan 2014 17:49:55 -0500 Subject: [PATCH 034/130] Detect whether perl tess regexes contain named registers. --- test/perl-tests.lisp | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/test/perl-tests.lisp b/test/perl-tests.lisp index f714c8c..e823ec6 100644 --- a/test/perl-tests.lisp +++ b/test/perl-tests.lisp @@ -105,19 +105,23 @@ test files." (when verbose (format t "~&~4D: ~S" counter info-string)) (block inner-test-block - (let ((scanner - (handler-bind ((error (lambda (condition) - (declare (ignore condition)) - (when perl-error - ;; we expected an - ;; error, so we can - ;; signal success - (return-from inner-test-block))))) - (create-scanner regex - :case-insensitive-mode case-insensitive-mode - :multi-line-mode multi-line-mode - :single-line-mode single-line-mode - :extended-mode extended-mode)))) + (let* ((parse-tree (ignore-errors (let ((*allow-named-registers* t)) + (parse-string regex)))) + (*allow-named-registers* (and parse-tree + (has-named-register-p parse-tree))) + (scanner + (handler-bind ((error (lambda (condition) + (declare (ignore condition)) + (when perl-error + ;; we expected an + ;; error, so we can + ;; signal success + (return-from inner-test-block))))) + (create-scanner regex + :case-insensitive-mode case-insensitive-mode + :multi-line-mode multi-line-mode + :single-line-mode single-line-mode + :extended-mode extended-mode)))) (multiple-value-bind (start end reg-starts reg-ends) (scan scanner target) (cond (perl-error @@ -148,3 +152,10 @@ test files." expected-result start) errors)))))) errors)))))))))) + +(defun has-named-register-p (parse-tree) + ;; A named register is present if :NAMED-REGISTER appears at the beginning of + ;; the list PARSE-TREE or of any of its sublists. + (and (consp parse-tree) + (or (eql (car parse-tree) :named-register) + (some #'has-named-register-p (cdr parse-tree))))) From 3bbe139e84a1d19b3995281a647a30a561ddcb71 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 7 Jan 2014 18:21:14 -0500 Subject: [PATCH 035/130] Add some additional (trivial) cases to ETYPECASE in CONVERT-NAMED-SUBPATTERN-REFS. --- convert.lisp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/convert.lisp b/convert.lisp index 9dfc144..dbaf39b 100644 --- a/convert.lisp +++ b/convert.lisp @@ -921,7 +921,9 @@ parse trees which are atoms.") (branch (mapc #'convert-named-subpattern-refs (list (then-regex converted-tree) (else-regex converted-tree)))) - ((or str char-class void)))) + ;; FIXME: Convert ETYPECASE -> TYPECASE once all possibilities are known to + ;; be accounted for. + ((or str char-class anchor back-reference everything void)))) (defun convert (parse-tree) "Converts the parse tree PARSE-TREE into an equivalent REGEX object and From b05a808044853edcc8a2fb9849ce07ddc089d802 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 7 Jan 2014 18:21:51 -0500 Subject: [PATCH 036/130] Add some tests for named subpattern references. --- test/perltestdata | 22 ++++++++++++++++++++++ test/perltestinput | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index 291f5d5..c13bcc0 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14312,3 +14312,25 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1649 "\"-12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1650 "\"xyz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1651 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1652 "\"abd\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "abd" nil "abd" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1653 "\"zcdxx\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1654 "\"abcabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1655 "\"xyzabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1656 "\"XYabcdY\" =~ /^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/" "^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1657 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/" "^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1658 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/" "^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1659 "\"abc\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1660 "\"a(b)c\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1661 "\"a(b(c))d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1662 "\">abc>123abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>123abc>123abc>1(2)3abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>(1(2)3)abc>(1(2)3)(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1666 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1667 "\"AmanaplanacanalPanama\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1668 "\"AblewasIereIsawElba\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1669 "\"12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1670 "\"(((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1671 "\"-12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1672 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1673 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) diff --git a/test/perltestinput b/test/perltestinput index 2e416ae..2945cd9 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -3996,3 +3996,45 @@ /^(x(y|(?1){2})z)/ xyz xxyzxyzz + +/^(?=(?®One))?[az](?[abc])d/ + abd + zcdxx + +/(?:(?abc)|(xyz))(?®One)/ + abcabc + xyzabc + +/^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/ + XYabcdY + +/^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/ + XYabcdY + +/^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/ + XYabcdY + +/^(?[^()]|\((?®One)*\))*$/ + abc + a(b)c + a(b(c))d + +/^>abc>(?[^()]|\((?®One)*\))*abc>123abc>1(2)3abc>(1(2)3)(.)(?®One)\2|)|(?(.)(?®Three)\4|.))$/i + 1221 + Satanoscillatemymetallicsonatas + AmanaplanacanalPanama + AblewasIereIsawElba + +/^(?\d+|\((?®One)([+*-])(?®One)\)|-(?®One))$/ + 12 + (((2+2)*-3)-7) + -12 + +/^(?x(y|(?®One){2})z)/ + xyz + xxyzxyzz From c70985fb72839f51b1a2ba65e5c4256c0db923fe Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 7 Jan 2014 20:42:11 -0500 Subject: [PATCH 037/130] Get rid of unused INSIDE-SUBPATTERN-REFERENCE variable. --- closures.lisp | 17 ++++++----------- scanner.lisp | 7 ++----- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/closures.lisp b/closures.lisp index 0650e7b..a3d637b 100644 --- a/closures.lisp +++ b/closures.lisp @@ -86,8 +86,7 @@ such that the call to NEXT-FN after the match would succeed.")) (defmethod create-matcher-aux ((register register) next-fn) (declare #.*standard-optimize-settings*) - (declare (special referenced-register-matchers - inside-subpattern-reference)) + (declare (special referenced-register-matchers)) ;; the position of this REGISTER within the whole regex; we start to ;; count at 0 (let ((num (num register))) @@ -121,19 +120,15 @@ such that the call to NEXT-FN after the match would succeed.")) (cond (other-fn ;; The presence of OTHER-FN indicates we have been called by a - ;; subpattern reference closure. Bind INSIDE-SUBPATTERN-REFERENCE - ;; and call the matcher for this register's regex. + ;; subpattern reference closure. (let ((next-pos - (let* ((inside-subpattern-reference t) - ;; Create a new temporary set of registers for - ;; matching back references while inside a - ;; subpattern reference, as with Perl. Cf. tests - ;; 1643-1646. - (reg-num (array-dimension *reg-starts* 0)) + ;; Create a new temporary set of registers for matching + ;; back references while inside a subpattern reference, as + ;; with Perl. Cf. tests 1643-1646. + (let* ((reg-num (array-dimension *reg-starts* 0)) (*reg-starts* (make-array reg-num :initial-element nil)) (*regs-maybe-start* (make-array reg-num :initial-element nil)) (*reg-ends* (make-array reg-num :initial-element nil))) - (declare (special inside-subpattern-reference)) (setf (svref *regs-maybe-start* num) start-pos) (funcall inner-matcher-without-next-fn start-pos)))) (when next-pos diff --git a/scanner.lisp b/scanner.lisp index a2f98ab..168dc6b 100644 --- a/scanner.lisp +++ b/scanner.lisp @@ -157,11 +157,8 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX." (str starts-with) nil)) ;; we don't need to try further than MAX-END-POS - (max-end-pos (- *end-pos* min-len)) - inside-subpattern-reference) - (declare (fixnum scan-start-pos) - (special inside-subpattern-reference) - (function match-fn)) + (max-end-pos (- *end-pos* min-len))) + (declare (fixnum scan-start-pos) (function match-fn)) ;; definition of ADVANCE-FN will be inserted here by macrology (labels ((advance-fn-definition)) (declare (inline advance-fn)) From cdb513c9451f0447e0546103361905fc53714942 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 7 Jan 2014 20:54:12 -0500 Subject: [PATCH 038/130] Only compute INNER-MATCHER-WITHOUT-NEXT-FN when it's needed. It's actually not clear that this is faster, though it probably is. --- closures.lisp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/closures.lisp b/closures.lisp index a3d637b..8bc5573 100644 --- a/closures.lisp +++ b/closures.lisp @@ -86,7 +86,7 @@ such that the call to NEXT-FN after the match would succeed.")) (defmethod create-matcher-aux ((register register) next-fn) (declare #.*standard-optimize-settings*) - (declare (special referenced-register-matchers)) + (declare (special referenced-register-matchers subpattern-refs)) ;; the position of this REGISTER within the whole regex; we start to ;; count at 0 (let ((num (num register))) @@ -104,14 +104,15 @@ such that the call to NEXT-FN after the match would succeed.")) ;; wrapped by this REGISTER ;; FIXME: We make two matchers here, one for matching within the register ;; itself, and the other for matching a subpattern reference referring to - ;; this register. This is far from ideal and probably not necessary. At - ;; the very least, we should only create the latter matcher when we know - ;; this register is to be referenced. + ;; this register. This is far from ideal and probably not necessary. (let ((inner-matcher (create-matcher-aux (regex register) #'store-end-of-reg)) - (inner-matcher-without-next-fn (create-matcher-aux - (regex register) - #'identity))) + (inner-matcher-without-next-fn (and (member (the fixnum (1+ num)) + (the list subpattern-refs) + :test #'=) + (create-matcher-aux + (regex register) + #'identity)))) (declare (function inner-matcher inner-matcher-without-next-fn)) ;; here comes the actual closure for REGISTER (setf (getf (car referenced-register-matchers) num) From 4fe74d03f4495af58f583fca1538d8494ed65a1b Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 08:16:13 -0500 Subject: [PATCH 039/130] Remove FIXME comment from closures.lisp, and rename one of the variables. There is another way to go about this, but there's really no telling which way would be faster. The advantage to contructing two matchers is that it only happens once and compilation time. --- closures.lisp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/closures.lisp b/closures.lisp index 8bc5573..7f4cd48 100644 --- a/closures.lisp +++ b/closures.lisp @@ -102,18 +102,17 @@ such that the call to NEXT-FN after the match would succeed.")) (funcall next-fn start-pos))) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER - ;; FIXME: We make two matchers here, one for matching within the register - ;; itself, and the other for matching a subpattern reference referring to - ;; this register. This is far from ideal and probably not necessary. (let ((inner-matcher (create-matcher-aux (regex register) #'store-end-of-reg)) - (inner-matcher-without-next-fn (and (member (the fixnum (1+ num)) - (the list subpattern-refs) - :test #'=) - (create-matcher-aux - (regex register) - #'identity)))) - (declare (function inner-matcher inner-matcher-without-next-fn)) + ;; When this register is reached directly through a subpattern + ;; reference, don't pass control to NEXT-FN. + (inner-matcher-subpattern-ref (and (member (the fixnum (1+ num)) + (the list subpattern-refs) + :test #'=) + (create-matcher-aux + (regex register) + #'identity)))) + (declare (function inner-matcher inner-matcher-subpattern-ref)) ;; here comes the actual closure for REGISTER (setf (getf (car referenced-register-matchers) num) (lambda (start-pos &optional other-fn) @@ -131,7 +130,7 @@ such that the call to NEXT-FN after the match would succeed.")) (*regs-maybe-start* (make-array reg-num :initial-element nil)) (*reg-ends* (make-array reg-num :initial-element nil))) (setf (svref *regs-maybe-start* num) start-pos) - (funcall inner-matcher-without-next-fn start-pos)))) + (funcall inner-matcher-subpattern-ref start-pos)))) (when next-pos (funcall (the function other-fn) next-pos)))) (t From 56243a17eb4a28e05154ff90106f99e927ab1753 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 08:32:09 -0500 Subject: [PATCH 040/130] Remove FIXME comment from CREATE-MATCHER-AUX for SUBPATTERN-REFERENCE. The optimization suggested there is trivial. --- closures.lisp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/closures.lisp b/closures.lisp index 7f4cd48..0b4817b 100644 --- a/closures.lisp +++ b/closures.lisp @@ -458,10 +458,8 @@ against CHR-EXPR." (declare #.*standard-optimize-settings*) (declare (special referenced-register-matchers) (function next-fn)) - ;; We have to close over the special variable REFERENCED-REGISTER-MATCHERS in - ;; order to reference it during the match phase. - ;; FIXME: In the case of forward subpattern references at least, we should be - ;; able to get at the register matcher during the matcher construction phase. + ;; Close over the special variable REFERENCED-REGISTER-MATCHERS in order to + ;; reference it during the match phase. (let ((num (num subpattern-reference)) (referenced-register-matchers referenced-register-matchers)) (declare (fixnum num) (function next-fn)) From 8591bd45c3503c02ff52610250bdc20aeeb95d63 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 08:45:18 -0500 Subject: [PATCH 041/130] Remove more FIXME comments. Perl does not allow whitespace around numbers/names in subpattern references. --- lexer.lisp | 2 -- 1 file changed, 2 deletions(-) diff --git a/lexer.lisp b/lexer.lisp index faa3c4a..cf59a5c 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -706,7 +706,6 @@ will also be consumed." next-char)) (let ((next-char (next-char lexer))) (if (alpha-char-p next-char) - ;; FIXME: Does Perl allow whitespace around register name here? (progn ;; put the letter back (decf (lexer-pos lexer)) @@ -725,7 +724,6 @@ will also be consumed." (when (or (null next-char) (not (char= (the character next-char) #\)))) ;; closing ) missing or not in the proper position - ;; FIXME: Does Perl allow whitespace around number here? (signal-syntax-error* (1- (lexer-pos lexer)) "Numbered subpattern reference has no closing #\\)."))))) From 8572c7a23eb1a59a18625567865b94861feea41a Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 10:22:44 -0500 Subject: [PATCH 042/130] Make named subpattern references refer to the first subpattern with the given name, as in Perl. This currently doesn't work for forward references. E.g.: (let ((ppcre::*allow-named-registers* t)) (ppcre:scan (ppcre:parse-string "(?&foo)(?f)(?o)") "ffo")) returns NIL. --- convert.lisp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/convert.lisp b/convert.lisp index dbaf39b..7074d49 100644 --- a/convert.lisp +++ b/convert.lisp @@ -902,16 +902,17 @@ parse trees which are atoms.") (etypecase converted-tree (subpattern-reference (when (= -1 (num converted-tree)) + ;; find which register corresponds to the given name (let* ((reg-name (name converted-tree)) - ;; find which register corresponds to the given name - ;; FIXME: When multiple named registers exist, do we want - ;; references to refer to the _last_? - (regs (loop for name in reg-names - for reg-index from 0 - when (string= name reg-name) - collect (- reg-num reg-index)))) - (pushnew (first regs) numbered-subpattern-refs :test #'=) - (setf (num converted-tree) (first regs))))) + (this-reg-num nil)) + ;; When more than one register have the same name, a named subpattern + ;; reference refers to the first. + (loop for name in reg-names + for reg-index from 0 + when (string= name reg-name) + do (setf this-reg-num (- reg-num reg-index))) + (pushnew this-reg-num numbered-subpattern-refs :test #'=) + (setf (num converted-tree) this-reg-num)))) (seq (mapc #'convert-named-subpattern-refs (elements converted-tree))) (alternation From 4d1c6097d5b6abfa8583769bee9081fe7b5dbc1f Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 10:37:41 -0500 Subject: [PATCH 043/130] Don't declare type of variable that may be either FUNCTION or NIL. --- closures.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/closures.lisp b/closures.lisp index 0b4817b..22505a1 100644 --- a/closures.lisp +++ b/closures.lisp @@ -112,7 +112,7 @@ such that the call to NEXT-FN after the match would succeed.")) (create-matcher-aux (regex register) #'identity)))) - (declare (function inner-matcher inner-matcher-subpattern-ref)) + (declare (function inner-matcher)) ;; here comes the actual closure for REGISTER (setf (getf (car referenced-register-matchers) num) (lambda (start-pos &optional other-fn) @@ -130,7 +130,7 @@ such that the call to NEXT-FN after the match would succeed.")) (*regs-maybe-start* (make-array reg-num :initial-element nil)) (*reg-ends* (make-array reg-num :initial-element nil))) (setf (svref *regs-maybe-start* num) start-pos) - (funcall inner-matcher-subpattern-ref start-pos)))) + (funcall (the function inner-matcher-subpattern-ref) start-pos)))) (when next-pos (funcall (the function other-fn) next-pos)))) (t From e4abae6707971bf88e8228429584e3ee6f83cd69 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 10:55:14 -0500 Subject: [PATCH 044/130] Add two tests (1652 and 1675) for testing forward subpattern references for special case. The special case is where the forward reference refers to the beginning of the constant end of string. These tests currently fail. --- test/perltestdata | 46 ++++++++++++++++++++++++---------------------- test/perltestinput | 6 ++++++ 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/test/perltestdata b/test/perltestdata index c13bcc0..2bbf2ed 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14312,25 +14312,27 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1649 "\"-12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1650 "\"xyz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1651 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1652 "\"abd\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "abd" nil "abd" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1653 "\"zcdxx\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1654 "\"abcabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1655 "\"xyzabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1656 "\"XYabcdY\" =~ /^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/" "^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1657 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/" "^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1658 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/" "^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1659 "\"abc\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1660 "\"a(b)c\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1661 "\"a(b(c))d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1662 "\">abc>123abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>123abc>123abc>1(2)3abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>(1(2)3)abc>(1(2)3)(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1666 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1667 "\"AmanaplanacanalPanama\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1668 "\"AblewasIereIsawElba\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1669 "\"12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1670 "\"(((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1671 "\"-12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1672 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1673 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1652 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1653 "\"abd\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "abd" nil "abd" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1654 "\"zcdxx\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1655 "\"abcabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1656 "\"xyzabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1657 "\"XYabcdY\" =~ /^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/" "^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1658 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/" "^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1659 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/" "^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1660 "\"abc\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1661 "\"a(b)c\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1662 "\"a(b(c))d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1663 "\">abc>123abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>123abc>123abc>1(2)3abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>(1(2)3)abc>(1(2)3)(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1667 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1668 "\"AmanaplanacanalPanama\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1669 "\"AblewasIereIsawElba\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1670 "\"12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1671 "\"(((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1672 "\"-12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1673 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1674 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1675 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) diff --git a/test/perltestinput b/test/perltestinput index 2945cd9..0eeb956 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -3997,6 +3997,9 @@ xyz xxyzxyzz +/(?1)(f)(o)/ + ffo + /^(?=(?®One))?[az](?[abc])d/ abd zcdxx @@ -4038,3 +4041,6 @@ /^(?x(y|(?®One){2})z)/ xyz xxyzxyzz + +/(?&foo)(?f)(?o)/ + ffo From 36acbdd49577cff90582e3ef3e7663c1311fe3ed Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 11:00:34 -0500 Subject: [PATCH 045/130] Reorder the subpattern reference tests. The tests are now so ordered that every numbered subpattern reference test is followed by a corresponding named subpattern reference test. --- test/perltestdata | 86 +++++++++++++++++++++++----------------------- test/perltestinput | 78 ++++++++++++++++++++--------------------- 2 files changed, 82 insertions(+), 82 deletions(-) diff --git a/test/perltestdata b/test/perltestdata index 2bbf2ed..3da7503 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14292,47 +14292,47 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1629 "\"aaaaaaaaaa\" =~ /((a{0,5}){0,5})*c/" "((a{0,5}){0,5})*c" nil nil nil nil "aaaaaaaaaa" nil nil nil) (1630 "\"abd\" =~ /^(?=(?1))?[az]([abc])d/" "^(?=(?1))?[az]([abc])d" nil nil nil nil "abd" nil "abd" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1631 "\"zcdxx\" =~ /^(?=(?1))?[az]([abc])d/" "^(?=(?1))?[az]([abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1632 "\"abcabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1633 "\"xyzabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1634 "\"XYabcdY\" =~ /^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/" "^X(?5)(a)(?:(b)|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1635 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1636 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1637 "\"abc\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1638 "\"a(b)c\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1639 "\"a(b(c))d\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1640 "\">abc>123abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>123abc>123abc>1(2)3abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>(1(2)3)abc>(1(2)3)[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "abd" nil "abd" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1654 "\"zcdxx\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1655 "\"abcabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1656 "\"xyzabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1657 "\"XYabcdY\" =~ /^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/" "^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1658 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/" "^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1659 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/" "^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1660 "\"abc\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1661 "\"a(b)c\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1662 "\"a(b(c))d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1663 "\">abc>123abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>123abc>123abc>1(2)3abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>(1(2)3)abc>(1(2)3)(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1667 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1668 "\"AmanaplanacanalPanama\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1669 "\"AblewasIereIsawElba\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1670 "\"12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1671 "\"(((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1672 "\"-12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1673 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1674 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1632 "\"abd\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "abd" nil "abd" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1633 "\"zcdxx\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1634 "\"abcabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1635 "\"xyzabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1636 "\"abcabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1637 "\"xyzabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1638 "\"XYabcdY\" =~ /^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/" "^X(?5)(a)(?:(b)|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1639 "\"XYabcdY\" =~ /^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/" "^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1640 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1641 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/" "^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1642 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1643 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/" "^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1644 "\"abc\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1645 "\"a(b)c\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1646 "\"a(b(c))d\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1647 "\"abc\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1648 "\"a(b)c\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1649 "\"a(b(c))d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1650 "\">abc>123abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>123abc>123abc>1(2)3abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>(1(2)3)abc>(1(2)3)abc>123abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>123abc>123abc>1(2)3abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>(1(2)3)abc>(1(2)3)(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1661 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1662 "\"AmanaplanacanalPanama\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1663 "\"AblewasIereIsawElba\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) +(1664 "\"12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1665 "\"(((2+2)*-3)-7)\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1666 "\"-12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1667 "\"12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1668 "\"(((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1669 "\"-12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1670 "\"xyz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1671 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1672 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1673 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1674 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1675 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) diff --git a/test/perltestinput b/test/perltestinput index 0eeb956..51cdd8a 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -3959,88 +3959,88 @@ abd zcdxx +/^(?=(?®One))?[az](?[abc])d/ + abd + zcdxx + /(?:(abc)|(xyz))(?1)/ abcabc xyzabc +/(?:(?abc)|(xyz))(?®One)/ + abcabc + xyzabc + /^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/ XYabcdY +/^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/ + XYabcdY + /^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)/ XYabcdY +/^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/ + XYabcdY + /^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)/ XYabcdY +/^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/ + XYabcdY + /^([^()]|\((?1)*\))*$/ abc a(b)c a(b(c))d +/^(?[^()]|\((?®One)*\))*$/ + abc + a(b)c + a(b(c))d + /^>abc>([^()]|\((?1)*\))*abc>123abc>1(2)3abc>(1(2)3)abc>(?[^()]|\((?®One)*\))*abc>123abc>1(2)3abc>(1(2)3)[abc])d/ - abd - zcdxx - -/(?:(?abc)|(xyz))(?®One)/ - abcabc - xyzabc - -/^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/ - XYabcdY - -/^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/ - XYabcdY - -/^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/ - XYabcdY - -/^(?[^()]|\((?®One)*\))*$/ - abc - a(b)c - a(b(c))d - -/^>abc>(?[^()]|\((?®One)*\))*abc>123abc>1(2)3abc>(1(2)3)(.)(?®One)\2|)|(?(.)(?®Three)\4|.))$/i 1221 Satanoscillatemymetallicsonatas AmanaplanacanalPanama AblewasIereIsawElba +/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ + 12 + (((2+2)*-3)-7) + -12 + /^(?\d+|\((?®One)([+*-])(?®One)\)|-(?®One))$/ 12 (((2+2)*-3)-7) -12 +/^(x(y|(?1){2})z)/ + xyz + xxyzxyzz + /^(?x(y|(?®One){2})z)/ xyz xxyzxyzz +/(?1)(f)(o)/ + ffo + /(?&foo)(?f)(?o)/ ffo From 87c9afc0f08a52724c1d5bd47d6c1d8f4cbf9632 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 14:19:22 -0500 Subject: [PATCH 046/130] Don't use START-OF-END-STRING-P optimization when subpattern references are present. --- optimize.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/optimize.lisp b/optimize.lisp index eabe8f2..bd0e375 100644 --- a/optimize.lisp +++ b/optimize.lisp @@ -496,7 +496,7 @@ function called by END-STRING.)")) nil))) (defun end-string (regex) - (declare (special end-string-offset)) + (declare (special end-string-offset subpattern-refs)) (declare #.*standard-optimize-settings*) "Returns the constant string (if it exists) REGEX ends with wrapped into a STR object, otherwise NIL." @@ -508,7 +508,9 @@ into a STR object, otherwise NIL." (declare (special continuep last-str)) (prog1 (end-string-aux regex) - (when last-str + ;; Don't set START-OF-END-STRING-P when subpattern references are present. + ;; FIXME: This may still be doable and preferable. + (when (and last-str (null subpattern-refs)) ;; if we've found something set the START-OF-END-STRING-P of ;; the leftmost STR collected accordingly and remember the ;; OFFSET of this STR (in a special variable provided by the From 662035425a270c6eaa67b1002609c62bdfa2cd11 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 14:57:06 -0500 Subject: [PATCH 047/130] Add tests for patterns containing illegal whitespace in subpattern references. --- test/perltestdata | 18 ++++++++++++++++++ test/perltestinput | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index 3da7503..baa9912 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14336,3 +14336,21 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1673 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1674 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1675 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1676 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) +(1677 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) +(1678 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) +(1679 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) +(1680 "\"foofoo\" =~ /(foo)(? 1 )/" "(foo)(? 1 )" nil nil nil nil "foofoo" t nil nil) +(1681 "\"foofoo\" =~ /(?foo)(?& foo )/" "(?foo)(?& foo )" nil nil nil nil "foofoo" t nil nil) +(1682 "\"foofoo\" =~ /(foo)(? +1)/" "(foo)(? +1)" nil nil nil nil "foofoo" t nil nil) +(1683 "\"foofoo\" =~ /(?foo)(?& +foo)/" "(?foo)(?& +foo)" nil nil nil nil "foofoo" t nil nil) +(1684 "\"foofoo\" =~ /(foo)(?1 +)/" "(foo)(?1 +)" nil nil nil nil "foofoo" t nil nil) +(1685 "\"foofoo\" =~ /(?foo)(?&foo +)/" "(?foo)(?&foo +)" nil nil nil nil "foofoo" t nil nil) diff --git a/test/perltestinput b/test/perltestinput index 51cdd8a..52e7862 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4044,3 +4044,37 @@ /(?&foo)(?f)(?o)/ ffo + +/(foo)(? 1)/ + foofoo + +/(?foo)(?& foo)/ + foofoo + +/(foo)(?1 )/ + foofoo + +/(?foo)(?&foo )/ + foofoo + +/(foo)(? 1 )/ + foofoo + +/(?foo)(?& foo )/ + foofoo + +/(foo)(? +1)/ + foofoo + +/(?foo)(?& +foo)/ + foofoo + +/(foo)(?1 +)/ + foofoo + +/(?foo)(?&foo +)/ + foofoo From 09ad0d400665406965f7a593f674e37c4abfb419 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 15:02:19 -0500 Subject: [PATCH 048/130] Bind *ALLOW-NAMED-REGISTERS* to NIL before running simple tests. If the user has bound this variable to T, the simple tests will not all pass. --- test/tests.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/tests.lisp b/test/tests.lisp index ae8ec04..7f67632 100644 --- a/test/tests.lisp +++ b/test/tests.lisp @@ -86,7 +86,8 @@ format which is used to read the file. Returns a true value iff all tests succeeded." (with-open-file (binary-stream file-name :element-type 'flex:octet) (let ((stream (flex:make-flexi-stream binary-stream :external-format external-format)) - (*package* (find-package :cl-ppcre-test))) + (*package* (find-package :cl-ppcre-test)) + (*allow-named-registers* nil)) (do-tests ((format nil "Simple tests from file ~S" (file-namestring file-name)) (not verbose)) (let ((form (or (read stream nil) (done)))) From 68d4215b55b2bfad3c67650d3d9c5ecb1d8f473c Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 15:19:35 -0500 Subject: [PATCH 049/130] Add two more tests for dealing with START-OF-END-STRING-P and subpattern references. --- test/perltestdata | 22 ++++++++++++---------- test/perltestinput | 6 ++++++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/test/perltestdata b/test/perltestdata index baa9912..e771e4d 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14336,21 +14336,23 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1673 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1674 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1675 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1676 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) -(1677 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) -(1678 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) -(1679 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) -(1680 "\"foofoo\" =~ /(foo)(? 1 )/" "(foo)(? 1 )" nil nil nil nil "foofoo" t nil nil) -(1681 "\"foofoo\" =~ /(?foo)(?& foo )/" "(?foo)(?& foo )" nil nil nil nil "foofoo" t nil nil) -(1682 "\"foofoo\" =~ /(foo)(? +(1676 "\"ofo\" =~ /(?2)(f)(o)/" "(?2)(f)(o)" nil nil nil nil "ofo" nil "ofo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1677 "\"ofo\" =~ /(?&foo)(f)(?o)/" "(?&foo)(f)(?o)" nil nil nil nil "ofo" nil "ofo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1678 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) +(1679 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) +(1680 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) +(1681 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) +(1682 "\"foofoo\" =~ /(foo)(? 1 )/" "(foo)(? 1 )" nil nil nil nil "foofoo" t nil nil) +(1683 "\"foofoo\" =~ /(?foo)(?& foo )/" "(?foo)(?& foo )" nil nil nil nil "foofoo" t nil nil) +(1684 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) -(1683 "\"foofoo\" =~ /(?foo)(?& +(1685 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) -(1684 "\"foofoo\" =~ /(foo)(?1 +(1686 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) -(1685 "\"foofoo\" =~ /(?foo)(?&foo +(1687 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) diff --git a/test/perltestinput b/test/perltestinput index 52e7862..6aa3dd0 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4045,6 +4045,12 @@ /(?&foo)(?f)(?o)/ ffo +/(?2)(f)(o)/ + ofo + +/(?&foo)(f)(?o)/ + ofo + /(foo)(? 1)/ foofoo From ffca226bbc7665d463b2629002af1446a7d89a36 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 12 Jan 2014 16:58:01 -0500 Subject: [PATCH 050/130] Add two more tests. These tests make sure that CL-PPCRE uses the correct named register when multiple registers have the same name. --- test/perltestdata | 30 ++++++++++++++++-------------- test/perltestinput | 4 ++++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/test/perltestdata b/test/perltestdata index e771e4d..ea8abb0 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14334,25 +14334,27 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1671 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1672 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1673 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1674 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1675 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1676 "\"ofo\" =~ /(?2)(f)(o)/" "(?2)(f)(o)" nil nil nil nil "ofo" nil "ofo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1677 "\"ofo\" =~ /(?&foo)(f)(?o)/" "(?&foo)(f)(?o)" nil nil nil nil "ofo" nil "ofo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1678 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) -(1679 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) -(1680 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) -(1681 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) -(1682 "\"foofoo\" =~ /(foo)(? 1 )/" "(foo)(? 1 )" nil nil nil nil "foofoo" t nil nil) -(1683 "\"foofoo\" =~ /(?foo)(?& foo )/" "(?foo)(?& foo )" nil nil nil nil "foofoo" t nil nil) -(1684 "\"foofoo\" =~ /(foo)(? +(1674 "\"foo\" =~ /(?f)(?o)(?&foo)/" "(?f)(?o)(?&foo)" nil nil nil nil "foo" nil nil nil) +(1675 "\"fof\" =~ /(?f)(?o)(?&foo)/" "(?f)(?o)(?&foo)" nil nil nil nil "fof" nil "fof" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1676 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1677 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1678 "\"ofo\" =~ /(?2)(f)(o)/" "(?2)(f)(o)" nil nil nil nil "ofo" nil "ofo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1679 "\"ofo\" =~ /(?&foo)(f)(?o)/" "(?&foo)(f)(?o)" nil nil nil nil "ofo" nil "ofo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1680 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) +(1681 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) +(1682 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) +(1683 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) +(1684 "\"foofoo\" =~ /(foo)(? 1 )/" "(foo)(? 1 )" nil nil nil nil "foofoo" t nil nil) +(1685 "\"foofoo\" =~ /(?foo)(?& foo )/" "(?foo)(?& foo )" nil nil nil nil "foofoo" t nil nil) +(1686 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) -(1685 "\"foofoo\" =~ /(?foo)(?& +(1687 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) -(1686 "\"foofoo\" =~ /(foo)(?1 +(1688 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) -(1687 "\"foofoo\" =~ /(?foo)(?&foo +(1689 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) diff --git a/test/perltestinput b/test/perltestinput index 6aa3dd0..b7e2d3c 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4039,6 +4039,10 @@ xyz xxyzxyzz +/(?f)(?o)(?&foo)/ + foo + fof + /(?1)(f)(o)/ ffo From e9c94db1fbacac940fd3748a86bc468b39f6d740 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 13 Jan 2014 17:00:45 -0500 Subject: [PATCH 051/130] Remove FIXME comment about disambiguating named subpattern references. This question has been answered an implemented in a previous commit. --- convert.lisp | 2 -- 1 file changed, 2 deletions(-) diff --git a/convert.lisp b/convert.lisp index 7074d49..bae356d 100644 --- a/convert.lisp +++ b/convert.lisp @@ -699,8 +699,6 @@ when NAME is not NIL." ;; Subpattern references may refer to registers that come later in the regex, ;; so we don't validate the subpattern name/number until the entire object has ;; been constructed. - ;; FIXME: In Perl, which named subpattern is referred to when there are more - ;; than one subpatterns of the same name? (let* ((reg (second parse-tree)) (reg-name (and (stringp reg) reg)) (reg-num (and (null reg-name) From d7d89411cc9061a56af9eca3e6fe35e101cee697 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 14 Jan 2014 17:38:31 -0500 Subject: [PATCH 052/130] Change FIXME comment in COMPUTE-OFFSETS method on SUBPATTERN-REFERENCE. --- regex-class-util.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/regex-class-util.lisp b/regex-class-util.lisp index e6ae7af..d1c20ed 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -558,7 +558,8 @@ slots of STR objects further down the tree.")) (defmethod compute-offsets ((subpattern-reference subpattern-reference) start-pos) (declare #.*standard-optimize-settings*) (declare (ignore start-pos)) - ;; FIXME: Not sure what this does... + ;; This is doable in limited cases but impossible for the most useful + ;; application of subpattern references, namely, recursive matching. nil) (defmethod compute-offsets ((filter filter) start-pos) From c5e06f75b78c8e1f5c4512d9082b6f0c15f8d84e Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 14 Jan 2014 17:47:48 -0500 Subject: [PATCH 053/130] Remove another FIXME comment. As with their offsets, determing the minimum lengths subpattern references is only feasible for patterns that don't really need subpattern references to begin with. --- regex-class-util.lisp | 1 - 1 file changed, 1 deletion(-) diff --git a/regex-class-util.lisp b/regex-class-util.lisp index d1c20ed..36c1c14 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -470,7 +470,6 @@ to this object, otherwise NIL. So, \"(.){1}\" would return true (declare #.*standard-optimize-settings*) ;; the general case for ANCHOR, BACK-REFERENCE, LOOKAHEAD, ;; LOOKBEHIND, SUBPATTERN-REFERENCE, VOID, and WORD-BOUNDARY - ;; FIXME: Compute SUBPATTERN-REFERENCE minimum length. 0) (defgeneric compute-offsets (regex start-pos) From e04ccda5a639677f2961218d3540c9a341af19ce Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 14 Jan 2014 17:51:29 -0500 Subject: [PATCH 054/130] Remove the FIXME comment from the REGEX-LENGTH method for SUBPATTERN-REFERENCE. --- regex-class-util.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/regex-class-util.lisp b/regex-class-util.lisp index 36c1c14..2d833c3 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -383,9 +383,9 @@ to this object, otherwise NIL. So, \"(.){1}\" would return true (defmethod regex-length ((subpattern-reference subpattern-reference)) (declare #.*standard-optimize-settings*) - ;; with enough effort we could possibly do better here, but - ;; currently we just give up and return NIL - ;; FIXME + ;; As with back references, this is possible for certain use cases; but it's + ;; impossible for recursive patterns, which are the main reason for subpattern + ;; references to begin with. nil) (defmethod regex-length ((char-class char-class)) From 1f1bba848413b9176ae8c03fa813c2862587c904 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 14 Jan 2014 18:11:19 -0500 Subject: [PATCH 055/130] Remove unused sub from perltest.pl eval. --- test/perltest.pl | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test/perltest.pl b/test/perltest.pl index b49d973..66bf72d 100644 --- a/test/perltest.pl +++ b/test/perltest.pl @@ -117,16 +117,6 @@ sub string_for_lisp { push \@subs,\$15; push \@subs,\$16; } - -\$test = sub { - my \$times = shift; - - my \$start = time; - for (my \$i = 0; \$i < \$times; \$i++) { - \$x =~ ${pattern}; - } - return time - \$start; -}; END $counter++; From 0b70e239786f08de282db2d66e42bbfa2df96730 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 14 Jan 2014 19:07:55 -0500 Subject: [PATCH 056/130] Make perltest.pl handle arbitrarily large and variable numbers of registers. The perltestdata file produced by this updated perltest.pl only reports results for registers that are actually contained in the corresponding pattern. --- test/perltest.pl | 38 +- test/perltestdata | 2406 ++++++++++++++++++++++----------------------- 2 files changed, 1213 insertions(+), 1231 deletions(-) diff --git a/test/perltest.pl b/test/perltest.pl index 66bf72d..812f5e2 100644 --- a/test/perltest.pl +++ b/test/perltest.pl @@ -99,23 +99,9 @@ sub string_for_lisp { eval <<"END"; if (\$x =~ ${pattern}) { - push \@subs,\$&; - push \@subs,\$1; - push \@subs,\$2; - push \@subs,\$3; - push \@subs,\$4; - push \@subs,\$5; - push \@subs,\$6; - push \@subs,\$7; - push \@subs,\$8; - push \@subs,\$9; - push \@subs,\$10; - push \@subs,\$11; - push \@subs,\$12; - push \@subs,\$13; - push \@subs,\$14; - push \@subs,\$15; - push \@subs,\$16; + push \@subs, \$&; + push \@subs, map { \$\$_ } (1 .. \$#-) + if \$#-; } END @@ -132,18 +118,14 @@ END if (!@subs) { print 'nil nil'; } else { - print string_for_lisp($subs[0]) . ' ('; - undef $not_first; - for ($i = 1; $i <= 16; $i++) { - print ' ' - unless $i == 1; - if (defined $subs[$i]) { - print string_for_lisp $subs[$i]; - } else { - print 'nil'; - } + print string_for_lisp($subs[0]), ' '; + shift @subs; + if (@subs) { + @lisp_strings = map { defined($_) ? string_for_lisp($_) : 'nil' } @subs; + print '(', join(' ', @lisp_strings), ')'; + } else { + print 'nil'; } - print ')'; } print ")\n"; } diff --git a/test/perltestdata b/test/perltestdata index ea8abb0..f6e703b 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -1,300 +1,300 @@ -(1 "\"the quick brown fox\" =~ /the quick brown fox/" "the quick brown fox" nil nil nil nil "the quick brown fox" nil "the quick brown fox" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1 "\"the quick brown fox\" =~ /the quick brown fox/" "the quick brown fox" nil nil nil nil "the quick brown fox" nil "the quick brown fox" nil) (2 "\"The quick brown FOX\" =~ /the quick brown fox/" "the quick brown fox" nil nil nil nil "The quick brown FOX" nil nil nil) -(3 "\"What do you know about the quick brown fox?\" =~ /the quick brown fox/" "the quick brown fox" nil nil nil nil "What do you know about the quick brown fox?" nil "the quick brown fox" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(3 "\"What do you know about the quick brown fox?\" =~ /the quick brown fox/" "the quick brown fox" nil nil nil nil "What do you know about the quick brown fox?" nil "the quick brown fox" nil) (4 "\"What do you know about THE QUICK BROWN FOX?\" =~ /the quick brown fox/" "the quick brown fox" nil nil nil nil "What do you know about THE QUICK BROWN FOX?" nil nil nil) -(5 "\"the quick brown fox\" =~ /The quick brown fox/i" "The quick brown fox" t nil nil nil "the quick brown fox" nil "the quick brown fox" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(6 "\"The quick brown FOX\" =~ /The quick brown fox/i" "The quick brown fox" t nil nil nil "The quick brown FOX" nil "The quick brown FOX" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(7 "\"What do you know about the quick brown fox?\" =~ /The quick brown fox/i" "The quick brown fox" t nil nil nil "What do you know about the quick brown fox?" nil "the quick brown fox" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(8 "\"What do you know about THE QUICK BROWN FOX?\" =~ /The quick brown fox/i" "The quick brown fox" t nil nil nil "What do you know about THE QUICK BROWN FOX?" nil "THE QUICK BROWN FOX" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(9 "\"abcd\\t\\n\\r\\f\\a\\e9;\\$\\\\?caxyz\" =~ /abcd\\t\\n\\r\\f\\a\\e\\071\\x3b\\$\\\\\\?caxyz/" "abcd\\t\\n\\r\\f\\a\\e\\071\\x3b\\$\\\\\\?caxyz" nil nil nil nil ("abcd" 9 10 13 12 7 27 "9;$\\?caxyz") nil ("abcd" 9 10 13 12 7 27 "9;$\\?caxyz") (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(10 "\"abxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abxyzpqrrrabbxyyyypqAzz" nil "abxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(11 "\"abxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abxyzpqrrrabbxyyyypqAzz" nil "abxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(12 "\"aabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aabxyzpqrrrabbxyyyypqAzz" nil "aabxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(13 "\"aaabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabxyzpqrrrabbxyyyypqAzz" nil "aaabxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(14 "\"aaaabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabxyzpqrrrabbxyyyypqAzz" nil "aaaabxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(15 "\"abcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abcxyzpqrrrabbxyyyypqAzz" nil "abcxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(16 "\"aabcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aabcxyzpqrrrabbxyyyypqAzz" nil "aabcxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(17 "\"aaabcxyzpqrrrabbxyyyypAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypAzz" nil "aaabcxyzpqrrrabbxyyyypAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(18 "\"aaabcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqAzz" nil "aaabcxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(19 "\"aaabcxyzpqrrrabbxyyyypqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(20 "\"aaabcxyzpqrrrabbxyyyypqqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(21 "\"aaabcxyzpqrrrabbxyyyypqqqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqqqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(22 "\"aaabcxyzpqrrrabbxyyyypqqqqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqqqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqqqqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(23 "\"aaabcxyzpqrrrabbxyyyypqqqqqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqqqqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqqqqqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(24 "\"aaaabcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzpqrrrabbxyyyypqAzz" nil "aaaabcxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(25 "\"abxyzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abxyzzpqrrrabbxyyyypqAzz" nil "abxyzzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(26 "\"aabxyzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aabxyzzzpqrrrabbxyyyypqAzz" nil "aabxyzzzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(27 "\"aaabxyzzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabxyzzzzpqrrrabbxyyyypqAzz" nil "aaabxyzzzzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(28 "\"aaaabxyzzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabxyzzzzpqrrrabbxyyyypqAzz" nil "aaaabxyzzzzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(29 "\"abcxyzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abcxyzzpqrrrabbxyyyypqAzz" nil "abcxyzzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(30 "\"aabcxyzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aabcxyzzzpqrrrabbxyyyypqAzz" nil "aabcxyzzzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(31 "\"aaabcxyzzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzzzzpqrrrabbxyyyypqAzz" nil "aaabcxyzzzzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(32 "\"aaaabcxyzzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzzzzpqrrrabbxyyyypqAzz" nil "aaaabcxyzzzzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(33 "\"aaaabcxyzzzzpqrrrabbbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzzzzpqrrrabbbxyyyypqAzz" nil "aaaabcxyzzzzpqrrrabbbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(34 "\"aaaabcxyzzzzpqrrrabbbxyyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzzzzpqrrrabbbxyyyyypqAzz" nil "aaaabcxyzzzzpqrrrabbbxyyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(35 "\"aaabcxyzpqrrrabbxyyyypABzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypABzz" nil "aaabcxyzpqrrrabbxyyyypABzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(36 "\"aaabcxyzpqrrrabbxyyyypABBzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypABBzz" nil "aaabcxyzpqrrrabbxyyyypABBzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(37 "\">>>aaabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil ">>>aaabxyzpqrrrabbxyyyypqAzz" nil "aaabxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(38 "\">aaaabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil ">aaaabxyzpqrrrabbxyyyypqAzz" nil "aaaabxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(39 "\">>>>abcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil ">>>>abcxyzpqrrrabbxyyyypqAzz" nil "abcxyzpqrrrabbxyyyypqAzz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(5 "\"the quick brown fox\" =~ /The quick brown fox/i" "The quick brown fox" t nil nil nil "the quick brown fox" nil "the quick brown fox" nil) +(6 "\"The quick brown FOX\" =~ /The quick brown fox/i" "The quick brown fox" t nil nil nil "The quick brown FOX" nil "The quick brown FOX" nil) +(7 "\"What do you know about the quick brown fox?\" =~ /The quick brown fox/i" "The quick brown fox" t nil nil nil "What do you know about the quick brown fox?" nil "the quick brown fox" nil) +(8 "\"What do you know about THE QUICK BROWN FOX?\" =~ /The quick brown fox/i" "The quick brown fox" t nil nil nil "What do you know about THE QUICK BROWN FOX?" nil "THE QUICK BROWN FOX" nil) +(9 "\"abcd\\t\\n\\r\\f\\a\\e9;\\$\\\\?caxyz\" =~ /abcd\\t\\n\\r\\f\\a\\e\\071\\x3b\\$\\\\\\?caxyz/" "abcd\\t\\n\\r\\f\\a\\e\\071\\x3b\\$\\\\\\?caxyz" nil nil nil nil ("abcd" 9 10 13 12 7 27 "9;$\\?caxyz") nil ("abcd" 9 10 13 12 7 27 "9;$\\?caxyz") nil) +(10 "\"abxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abxyzpqrrrabbxyyyypqAzz" nil "abxyzpqrrrabbxyyyypqAzz" nil) +(11 "\"abxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abxyzpqrrrabbxyyyypqAzz" nil "abxyzpqrrrabbxyyyypqAzz" nil) +(12 "\"aabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aabxyzpqrrrabbxyyyypqAzz" nil "aabxyzpqrrrabbxyyyypqAzz" nil) +(13 "\"aaabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabxyzpqrrrabbxyyyypqAzz" nil "aaabxyzpqrrrabbxyyyypqAzz" nil) +(14 "\"aaaabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabxyzpqrrrabbxyyyypqAzz" nil "aaaabxyzpqrrrabbxyyyypqAzz" nil) +(15 "\"abcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abcxyzpqrrrabbxyyyypqAzz" nil "abcxyzpqrrrabbxyyyypqAzz" nil) +(16 "\"aabcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aabcxyzpqrrrabbxyyyypqAzz" nil "aabcxyzpqrrrabbxyyyypqAzz" nil) +(17 "\"aaabcxyzpqrrrabbxyyyypAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypAzz" nil "aaabcxyzpqrrrabbxyyyypAzz" nil) +(18 "\"aaabcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqAzz" nil "aaabcxyzpqrrrabbxyyyypqAzz" nil) +(19 "\"aaabcxyzpqrrrabbxyyyypqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqAzz" nil) +(20 "\"aaabcxyzpqrrrabbxyyyypqqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqqAzz" nil) +(21 "\"aaabcxyzpqrrrabbxyyyypqqqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqqqAzz" nil) +(22 "\"aaabcxyzpqrrrabbxyyyypqqqqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqqqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqqqqAzz" nil) +(23 "\"aaabcxyzpqrrrabbxyyyypqqqqqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqqqqqAzz" nil "aaabcxyzpqrrrabbxyyyypqqqqqqAzz" nil) +(24 "\"aaaabcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzpqrrrabbxyyyypqAzz" nil "aaaabcxyzpqrrrabbxyyyypqAzz" nil) +(25 "\"abxyzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abxyzzpqrrrabbxyyyypqAzz" nil "abxyzzpqrrrabbxyyyypqAzz" nil) +(26 "\"aabxyzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aabxyzzzpqrrrabbxyyyypqAzz" nil "aabxyzzzpqrrrabbxyyyypqAzz" nil) +(27 "\"aaabxyzzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabxyzzzzpqrrrabbxyyyypqAzz" nil "aaabxyzzzzpqrrrabbxyyyypqAzz" nil) +(28 "\"aaaabxyzzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabxyzzzzpqrrrabbxyyyypqAzz" nil "aaaabxyzzzzpqrrrabbxyyyypqAzz" nil) +(29 "\"abcxyzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abcxyzzpqrrrabbxyyyypqAzz" nil "abcxyzzpqrrrabbxyyyypqAzz" nil) +(30 "\"aabcxyzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aabcxyzzzpqrrrabbxyyyypqAzz" nil "aabcxyzzzpqrrrabbxyyyypqAzz" nil) +(31 "\"aaabcxyzzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzzzzpqrrrabbxyyyypqAzz" nil "aaabcxyzzzzpqrrrabbxyyyypqAzz" nil) +(32 "\"aaaabcxyzzzzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzzzzpqrrrabbxyyyypqAzz" nil "aaaabcxyzzzzpqrrrabbxyyyypqAzz" nil) +(33 "\"aaaabcxyzzzzpqrrrabbbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzzzzpqrrrabbbxyyyypqAzz" nil "aaaabcxyzzzzpqrrrabbbxyyyypqAzz" nil) +(34 "\"aaaabcxyzzzzpqrrrabbbxyyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzzzzpqrrrabbbxyyyyypqAzz" nil "aaaabcxyzzzzpqrrrabbbxyyyyypqAzz" nil) +(35 "\"aaabcxyzpqrrrabbxyyyypABzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypABzz" nil "aaabcxyzpqrrrabbxyyyypABzz" nil) +(36 "\"aaabcxyzpqrrrabbxyyyypABBzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypABBzz" nil "aaabcxyzpqrrrabbxyyyypABBzz" nil) +(37 "\">>>aaabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil ">>>aaabxyzpqrrrabbxyyyypqAzz" nil "aaabxyzpqrrrabbxyyyypqAzz" nil) +(38 "\">aaaabxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil ">aaaabxyzpqrrrabbxyyyypqAzz" nil "aaaabxyzpqrrrabbxyyyypqAzz" nil) +(39 "\">>>>abcxyzpqrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil ">>>>abcxyzpqrrrabbxyyyypqAzz" nil "abcxyzpqrrrabbxyyyypqAzz" nil) (40 "\"abxyzpqrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abxyzpqrrabbxyyyypqAzz" nil nil nil) (41 "\"abxyzpqrrrrabbxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abxyzpqrrrrabbxyyyypqAzz" nil nil nil) (42 "\"abxyzpqrrrabxyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "abxyzpqrrrabxyyyypqAzz" nil nil nil) (43 "\"aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz" nil nil nil) (44 "\"aaaabcxyzzzzpqrrrabbbxyyypqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaaabcxyzzzzpqrrrabbbxyyypqAzz" nil nil nil) (45 "\"aaabcxyzpqrrrabbxyyyypqqqqqqqAzz\" =~ /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/" "a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz" nil nil nil nil "aaabcxyzpqrrrabbxyyyypqqqqqqqAzz" nil nil nil) -(46 "\"abczz\" =~ /^(abc){1,2}zz/" "^(abc){1,2}zz" nil nil nil nil "abczz" nil "abczz" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(47 "\"abcabczz\" =~ /^(abc){1,2}zz/" "^(abc){1,2}zz" nil nil nil nil "abcabczz" nil "abcabczz" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(46 "\"abczz\" =~ /^(abc){1,2}zz/" "^(abc){1,2}zz" nil nil nil nil "abczz" nil "abczz" ("abc")) +(47 "\"abcabczz\" =~ /^(abc){1,2}zz/" "^(abc){1,2}zz" nil nil nil nil "abcabczz" nil "abcabczz" ("abc")) (48 "\"zz\" =~ /^(abc){1,2}zz/" "^(abc){1,2}zz" nil nil nil nil "zz" nil nil nil) (49 "\"abcabcabczz\" =~ /^(abc){1,2}zz/" "^(abc){1,2}zz" nil nil nil nil "abcabcabczz" nil nil nil) (50 "\">>abczz\" =~ /^(abc){1,2}zz/" "^(abc){1,2}zz" nil nil nil nil ">>abczz" nil nil nil) -(51 "\"bc\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bc" nil "bc" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(52 "\"bbc\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbc" nil "bbc" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(53 "\"bbbc\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbc" nil "bbbc" ("bb" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(54 "\"bac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bac" nil "bac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(55 "\"bbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbac" nil "bbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(56 "\"aac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "aac" nil "aac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(57 "\"abbbbbbbbbbbc\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "abbbbbbbbbbbc" nil "abbbbbbbbbbbc" ("bbbbbbbbbbb" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(58 "\"bbbbbbbbbbbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbbbbbbbbbac" nil "bbbbbbbbbbbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(51 "\"bc\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bc" nil "bc" ("b")) +(52 "\"bbc\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbc" nil "bbc" ("b")) +(53 "\"bbbc\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbc" nil "bbbc" ("bb")) +(54 "\"bac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bac" nil "bac" ("a")) +(55 "\"bbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbac" nil "bbac" ("a")) +(56 "\"aac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "aac" nil "aac" ("a")) +(57 "\"abbbbbbbbbbbc\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "abbbbbbbbbbbc" nil "abbbbbbbbbbbc" ("bbbbbbbbbbb")) +(58 "\"bbbbbbbbbbbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbbbbbbbbbac" nil "bbbbbbbbbbbac" ("a")) (59 "\"aaac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "aaac" nil nil nil) (60 "\"abbbbbbbbbbbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "abbbbbbbbbbbac" nil nil nil) -(61 "\"bc\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bc" nil "bc" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(62 "\"bbc\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bbc" nil "bbc" ("bb" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(63 "\"bbbc\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bbbc" nil "bbbc" ("bbb" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(64 "\"bac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bac" nil "bac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(65 "\"bbac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bbac" nil "bbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(66 "\"aac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "aac" nil "aac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(67 "\"abbbbbbbbbbbc\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "abbbbbbbbbbbc" nil "abbbbbbbbbbbc" ("bbbbbbbbbbb" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(68 "\"bbbbbbbbbbbac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bbbbbbbbbbbac" nil "bbbbbbbbbbbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(61 "\"bc\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bc" nil "bc" ("b")) +(62 "\"bbc\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bbc" nil "bbc" ("bb")) +(63 "\"bbbc\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bbbc" nil "bbbc" ("bbb")) +(64 "\"bac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bac" nil "bac" ("a")) +(65 "\"bbac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bbac" nil "bbac" ("a")) +(66 "\"aac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "aac" nil "aac" ("a")) +(67 "\"abbbbbbbbbbbc\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "abbbbbbbbbbbc" nil "abbbbbbbbbbbc" ("bbbbbbbbbbb")) +(68 "\"bbbbbbbbbbbac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "bbbbbbbbbbbac" nil "bbbbbbbbbbbac" ("a")) (69 "\"aaac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "aaac" nil nil nil) (70 "\"abbbbbbbbbbbac\" =~ /^(b+|a){1,2}c/" "^(b+|a){1,2}c" nil nil nil nil "abbbbbbbbbbbac" nil nil nil) -(71 "\"bbc\" =~ /^(b+|a){1,2}?bc/" "^(b+|a){1,2}?bc" nil nil nil nil "bbc" nil "bbc" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(72 "\"babc\" =~ /^(b*|ba){1,2}?bc/" "^(b*|ba){1,2}?bc" nil nil nil nil "babc" nil "babc" ("ba" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(73 "\"bbabc\" =~ /^(b*|ba){1,2}?bc/" "^(b*|ba){1,2}?bc" nil nil nil nil "bbabc" nil "bbabc" ("ba" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(74 "\"bababc\" =~ /^(b*|ba){1,2}?bc/" "^(b*|ba){1,2}?bc" nil nil nil nil "bababc" nil "bababc" ("ba" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(71 "\"bbc\" =~ /^(b+|a){1,2}?bc/" "^(b+|a){1,2}?bc" nil nil nil nil "bbc" nil "bbc" ("b")) +(72 "\"babc\" =~ /^(b*|ba){1,2}?bc/" "^(b*|ba){1,2}?bc" nil nil nil nil "babc" nil "babc" ("ba")) +(73 "\"bbabc\" =~ /^(b*|ba){1,2}?bc/" "^(b*|ba){1,2}?bc" nil nil nil nil "bbabc" nil "bbabc" ("ba")) +(74 "\"bababc\" =~ /^(b*|ba){1,2}?bc/" "^(b*|ba){1,2}?bc" nil nil nil nil "bababc" nil "bababc" ("ba")) (75 "\"bababbc\" =~ /^(b*|ba){1,2}?bc/" "^(b*|ba){1,2}?bc" nil nil nil nil "bababbc" nil nil nil) (76 "\"babababc\" =~ /^(b*|ba){1,2}?bc/" "^(b*|ba){1,2}?bc" nil nil nil nil "babababc" nil nil nil) -(77 "\"babc\" =~ /^(ba|b*){1,2}?bc/" "^(ba|b*){1,2}?bc" nil nil nil nil "babc" nil "babc" ("ba" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(78 "\"bbabc\" =~ /^(ba|b*){1,2}?bc/" "^(ba|b*){1,2}?bc" nil nil nil nil "bbabc" nil "bbabc" ("ba" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(79 "\"bababc\" =~ /^(ba|b*){1,2}?bc/" "^(ba|b*){1,2}?bc" nil nil nil nil "bababc" nil "bababc" ("ba" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(77 "\"babc\" =~ /^(ba|b*){1,2}?bc/" "^(ba|b*){1,2}?bc" nil nil nil nil "babc" nil "babc" ("ba")) +(78 "\"bbabc\" =~ /^(ba|b*){1,2}?bc/" "^(ba|b*){1,2}?bc" nil nil nil nil "bbabc" nil "bbabc" ("ba")) +(79 "\"bababc\" =~ /^(ba|b*){1,2}?bc/" "^(ba|b*){1,2}?bc" nil nil nil nil "bababc" nil "bababc" ("ba")) (80 "\"bababbc\" =~ /^(ba|b*){1,2}?bc/" "^(ba|b*){1,2}?bc" nil nil nil nil "bababbc" nil nil nil) (81 "\"babababc\" =~ /^(ba|b*){1,2}?bc/" "^(ba|b*){1,2}?bc" nil nil nil nil "babababc" nil nil nil) -(82 "\"\\x01\\x01\\e;z\" =~ /^\\ca\\cA\\c[\\c{\\c:/" "^\\ca\\cA\\c[\\c{\\c:" nil nil nil nil ("" 1 1 27 ";z") nil ("" 1 1 27 ";z") (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(83 "\"athing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "athing" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(84 "\"bthing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "bthing" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(85 "\"]thing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "]thing" nil "]" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(86 "\"cthing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "cthing" nil "c" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(87 "\"dthing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "dthing" nil "d" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(88 "\"ething\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "ething" nil "e" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(82 "\"\\x01\\x01\\e;z\" =~ /^\\ca\\cA\\c[\\c{\\c:/" "^\\ca\\cA\\c[\\c{\\c:" nil nil nil nil ("" 1 1 27 ";z") nil ("" 1 1 27 ";z") nil) +(83 "\"athing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "athing" nil "a" nil) +(84 "\"bthing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "bthing" nil "b" nil) +(85 "\"]thing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "]thing" nil "]" nil) +(86 "\"cthing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "cthing" nil "c" nil) +(87 "\"dthing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "dthing" nil "d" nil) +(88 "\"ething\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "ething" nil "e" nil) (89 "\"fthing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "fthing" nil nil nil) (90 "\"[thing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "[thing" nil nil nil) (91 "\"\\\\thing\" =~ /^[ab\\]cde]/" "^[ab\\]cde]" nil nil nil nil "\\thing" nil nil nil) -(92 "\"]thing\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "]thing" nil "]" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(93 "\"cthing\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "cthing" nil "c" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(94 "\"dthing\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "dthing" nil "d" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(95 "\"ething\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "ething" nil "e" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(92 "\"]thing\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "]thing" nil "]" nil) +(93 "\"cthing\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "cthing" nil "c" nil) +(94 "\"dthing\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "dthing" nil "d" nil) +(95 "\"ething\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "ething" nil "e" nil) (96 "\"athing\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "athing" nil nil nil) (97 "\"fthing\" =~ /^[]cde]/" "^[]cde]" nil nil nil nil "fthing" nil nil nil) -(98 "\"fthing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "fthing" nil "f" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(99 "\"[thing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "[thing" nil "[" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(100 "\"\\\\thing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "\\thing" nil "\\" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(98 "\"fthing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "fthing" nil "f" nil) +(99 "\"[thing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "[thing" nil "[" nil) +(100 "\"\\\\thing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "\\thing" nil "\\" nil) (101 "\"athing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "athing" nil nil nil) (102 "\"bthing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "bthing" nil nil nil) (103 "\"]thing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "]thing" nil nil nil) (104 "\"cthing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "cthing" nil nil nil) (105 "\"dthing\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "dthing" nil nil nil) (106 "\"ething\" =~ /^[^ab\\]cde]/" "^[^ab\\]cde]" nil nil nil nil "ething" nil nil nil) -(107 "\"athing\" =~ /^[^]cde]/" "^[^]cde]" nil nil nil nil "athing" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(108 "\"fthing\" =~ /^[^]cde]/" "^[^]cde]" nil nil nil nil "fthing" nil "f" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(107 "\"athing\" =~ /^[^]cde]/" "^[^]cde]" nil nil nil nil "athing" nil "a" nil) +(108 "\"fthing\" =~ /^[^]cde]/" "^[^]cde]" nil nil nil nil "fthing" nil "f" nil) (109 "\"]thing\" =~ /^[^]cde]/" "^[^]cde]" nil nil nil nil "]thing" nil nil nil) (110 "\"cthing\" =~ /^[^]cde]/" "^[^]cde]" nil nil nil nil "cthing" nil nil nil) (111 "\"dthing\" =~ /^[^]cde]/" "^[^]cde]" nil nil nil nil "dthing" nil nil nil) (112 "\"ething\" =~ /^[^]cde]/" "^[^]cde]" nil nil nil nil "ething" nil nil nil) -(113 ("\"" 129 "\" =~ /^\\" 129 "/") "^\\" nil nil nil nil ("" 129) nil ("" 129) (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(114 ("\"" 255 "\" =~ /^" 255 "/") "^ÿ" nil nil nil nil ("" 255) nil ("" 255) (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(115 "\"0\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "0" nil "0" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(116 "\"1\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "1" nil "1" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(117 "\"2\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "2" nil "2" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(118 "\"3\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "3" nil "3" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(119 "\"4\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "4" nil "4" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(120 "\"5\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "5" nil "5" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(121 "\"6\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "6" nil "6" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(122 "\"7\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "7" nil "7" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(123 "\"8\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "8" nil "8" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(124 "\"9\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "9" nil "9" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(125 "\"10\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "10" nil "10" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(126 "\"100\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "100" nil "100" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(113 ("\"" 129 "\" =~ /^\\" 129 "/") "^\\" nil nil nil nil ("" 129) nil ("" 129) nil) +(114 ("\"" 255 "\" =~ /^" 255 "/") "^ÿ" nil nil nil nil ("" 255) nil ("" 255) nil) +(115 "\"0\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "0" nil "0" nil) +(116 "\"1\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "1" nil "1" nil) +(117 "\"2\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "2" nil "2" nil) +(118 "\"3\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "3" nil "3" nil) +(119 "\"4\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "4" nil "4" nil) +(120 "\"5\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "5" nil "5" nil) +(121 "\"6\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "6" nil "6" nil) +(122 "\"7\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "7" nil "7" nil) +(123 "\"8\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "8" nil "8" nil) +(124 "\"9\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "9" nil "9" nil) +(125 "\"10\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "10" nil "10" nil) +(126 "\"100\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "100" nil "100" nil) (127 "\"abc\" =~ /^[0-9]+$/" "^[0-9]+$" nil nil nil nil "abc" nil nil nil) -(128 "\"enter\" =~ /^.*nter/" "^.*nter" nil nil nil nil "enter" nil "enter" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(129 "\"inter\" =~ /^.*nter/" "^.*nter" nil nil nil nil "inter" nil "inter" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(130 "\"uponter\" =~ /^.*nter/" "^.*nter" nil nil nil nil "uponter" nil "uponter" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(131 "\"xxx0\" =~ /^xxx[0-9]+$/" "^xxx[0-9]+$" nil nil nil nil "xxx0" nil "xxx0" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(132 "\"xxx1234\" =~ /^xxx[0-9]+$/" "^xxx[0-9]+$" nil nil nil nil "xxx1234" nil "xxx1234" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(128 "\"enter\" =~ /^.*nter/" "^.*nter" nil nil nil nil "enter" nil "enter" nil) +(129 "\"inter\" =~ /^.*nter/" "^.*nter" nil nil nil nil "inter" nil "inter" nil) +(130 "\"uponter\" =~ /^.*nter/" "^.*nter" nil nil nil nil "uponter" nil "uponter" nil) +(131 "\"xxx0\" =~ /^xxx[0-9]+$/" "^xxx[0-9]+$" nil nil nil nil "xxx0" nil "xxx0" nil) +(132 "\"xxx1234\" =~ /^xxx[0-9]+$/" "^xxx[0-9]+$" nil nil nil nil "xxx1234" nil "xxx1234" nil) (133 "\"xxx\" =~ /^xxx[0-9]+$/" "^xxx[0-9]+$" nil nil nil nil "xxx" nil nil nil) -(134 "\"x123\" =~ /^.+[0-9][0-9][0-9]$/" "^.+[0-9][0-9][0-9]$" nil nil nil nil "x123" nil "x123" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(135 "\"xx123\" =~ /^.+[0-9][0-9][0-9]$/" "^.+[0-9][0-9][0-9]$" nil nil nil nil "xx123" nil "xx123" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(136 "\"123456\" =~ /^.+[0-9][0-9][0-9]$/" "^.+[0-9][0-9][0-9]$" nil nil nil nil "123456" nil "123456" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(134 "\"x123\" =~ /^.+[0-9][0-9][0-9]$/" "^.+[0-9][0-9][0-9]$" nil nil nil nil "x123" nil "x123" nil) +(135 "\"xx123\" =~ /^.+[0-9][0-9][0-9]$/" "^.+[0-9][0-9][0-9]$" nil nil nil nil "xx123" nil "xx123" nil) +(136 "\"123456\" =~ /^.+[0-9][0-9][0-9]$/" "^.+[0-9][0-9][0-9]$" nil nil nil nil "123456" nil "123456" nil) (137 "\"123\" =~ /^.+[0-9][0-9][0-9]$/" "^.+[0-9][0-9][0-9]$" nil nil nil nil "123" nil nil nil) -(138 "\"x1234\" =~ /^.+[0-9][0-9][0-9]$/" "^.+[0-9][0-9][0-9]$" nil nil nil nil "x1234" nil "x1234" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(139 "\"x123\" =~ /^.+?[0-9][0-9][0-9]$/" "^.+?[0-9][0-9][0-9]$" nil nil nil nil "x123" nil "x123" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(140 "\"xx123\" =~ /^.+?[0-9][0-9][0-9]$/" "^.+?[0-9][0-9][0-9]$" nil nil nil nil "xx123" nil "xx123" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(141 "\"123456\" =~ /^.+?[0-9][0-9][0-9]$/" "^.+?[0-9][0-9][0-9]$" nil nil nil nil "123456" nil "123456" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(138 "\"x1234\" =~ /^.+[0-9][0-9][0-9]$/" "^.+[0-9][0-9][0-9]$" nil nil nil nil "x1234" nil "x1234" nil) +(139 "\"x123\" =~ /^.+?[0-9][0-9][0-9]$/" "^.+?[0-9][0-9][0-9]$" nil nil nil nil "x123" nil "x123" nil) +(140 "\"xx123\" =~ /^.+?[0-9][0-9][0-9]$/" "^.+?[0-9][0-9][0-9]$" nil nil nil nil "xx123" nil "xx123" nil) +(141 "\"123456\" =~ /^.+?[0-9][0-9][0-9]$/" "^.+?[0-9][0-9][0-9]$" nil nil nil nil "123456" nil "123456" nil) (142 "\"123\" =~ /^.+?[0-9][0-9][0-9]$/" "^.+?[0-9][0-9][0-9]$" nil nil nil nil "123" nil nil nil) -(143 "\"x1234\" =~ /^.+?[0-9][0-9][0-9]$/" "^.+?[0-9][0-9][0-9]$" nil nil nil nil "x1234" nil "x1234" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(144 "\"abc!pqr=apquxz.ixr.zzz.ac.uk\" =~ /^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$/" "^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$" nil nil nil nil "abc!pqr=apquxz.ixr.zzz.ac.uk" nil "abc!pqr=apquxz.ixr.zzz.ac.uk" ("abc" "pqr" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(143 "\"x1234\" =~ /^.+?[0-9][0-9][0-9]$/" "^.+?[0-9][0-9][0-9]$" nil nil nil nil "x1234" nil "x1234" nil) +(144 "\"abc!pqr=apquxz.ixr.zzz.ac.uk\" =~ /^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$/" "^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$" nil nil nil nil "abc!pqr=apquxz.ixr.zzz.ac.uk" nil "abc!pqr=apquxz.ixr.zzz.ac.uk" ("abc" "pqr")) (145 "\"!pqr=apquxz.ixr.zzz.ac.uk\" =~ /^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$/" "^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$" nil nil nil nil "!pqr=apquxz.ixr.zzz.ac.uk" nil nil nil) (146 "\"abc!=apquxz.ixr.zzz.ac.uk\" =~ /^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$/" "^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$" nil nil nil nil "abc!=apquxz.ixr.zzz.ac.uk" nil nil nil) (147 "\"abc!pqr=apquxz:ixr.zzz.ac.uk\" =~ /^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$/" "^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$" nil nil nil nil "abc!pqr=apquxz:ixr.zzz.ac.uk" nil nil nil) (148 "\"abc!pqr=apquxz.ixr.zzz.ac.ukk\" =~ /^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$/" "^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$" nil nil nil nil "abc!pqr=apquxz.ixr.zzz.ac.ukk" nil nil nil) -(149 "\"Well, we need a colon: somewhere\" =~ /:/" ":" nil nil nil nil "Well, we need a colon: somewhere" nil ":" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(149 "\"Well, we need a colon: somewhere\" =~ /:/" ":" nil nil nil nil "Well, we need a colon: somewhere" nil ":" nil) (150 "\"Fail if we don't\" =~ /:/" ":" nil nil nil nil "Fail if we don't" nil nil nil) -(151 "\"0abc\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "0abc" nil "0abc" ("0abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(152 "\"abc\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "abc" nil "abc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(153 "\"fed\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "fed" nil "fed" ("fed" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(154 "\"E\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "E" nil "E" ("E" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(155 "\"::\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "::" nil "::" ("::" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(156 "\"5f03:12C0::932e\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "5f03:12C0::932e" nil "5f03:12C0::932e" ("5f03:12C0::932e" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(157 "\"fed def\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "fed def" nil "def" ("def" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(158 "\"Any old stuff\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "Any old stuff" nil "ff" ("ff" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(151 "\"0abc\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "0abc" nil "0abc" ("0abc")) +(152 "\"abc\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "abc" nil "abc" ("abc")) +(153 "\"fed\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "fed" nil "fed" ("fed")) +(154 "\"E\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "E" nil "E" ("E")) +(155 "\"::\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "::" nil "::" ("::")) +(156 "\"5f03:12C0::932e\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "5f03:12C0::932e" nil "5f03:12C0::932e" ("5f03:12C0::932e")) +(157 "\"fed def\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "fed def" nil "def" ("def")) +(158 "\"Any old stuff\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "Any old stuff" nil "ff" ("ff")) (159 "\"0zzz\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "0zzz" nil nil nil) (160 "\"gzzz\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "gzzz" nil nil nil) (161 "\"fed\\x20\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "fed " nil nil nil) (162 "\"Any old rubbish\" =~ /([\\da-f:]+)$/i" "([\\da-f:]+)$" t nil nil nil "Any old rubbish" nil nil nil) -(163 "\".1.2.3\" =~ /^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/" "^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$" nil nil nil nil ".1.2.3" nil ".1.2.3" ("1" "2" "3" nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(164 "\"A.12.123.0\" =~ /^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/" "^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$" nil nil nil nil "A.12.123.0" nil "A.12.123.0" ("12" "123" "0" nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(163 "\".1.2.3\" =~ /^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/" "^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$" nil nil nil nil ".1.2.3" nil ".1.2.3" ("1" "2" "3")) +(164 "\"A.12.123.0\" =~ /^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/" "^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$" nil nil nil nil "A.12.123.0" nil "A.12.123.0" ("12" "123" "0")) (165 "\".1.2.3333\" =~ /^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/" "^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$" nil nil nil nil ".1.2.3333" nil nil nil) (166 "\"1.2.3\" =~ /^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/" "^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$" nil nil nil nil "1.2.3" nil nil nil) (167 "\"1234.2.3\" =~ /^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/" "^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$" nil nil nil nil "1234.2.3" nil nil nil) -(168 "\"1 IN SOA non-sp1 non-sp2(\" =~ /^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$/" "^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$" nil nil nil nil "1 IN SOA non-sp1 non-sp2(" nil "1 IN SOA non-sp1 non-sp2(" ("1" "non-sp1" "non-sp2" nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(169 "\"1 IN SOA non-sp1 non-sp2 (\" =~ /^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$/" "^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$" nil nil nil nil "1 IN SOA non-sp1 non-sp2 (" nil "1 IN SOA non-sp1 non-sp2 (" ("1" "non-sp1" "non-sp2" nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(168 "\"1 IN SOA non-sp1 non-sp2(\" =~ /^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$/" "^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$" nil nil nil nil "1 IN SOA non-sp1 non-sp2(" nil "1 IN SOA non-sp1 non-sp2(" ("1" "non-sp1" "non-sp2")) +(169 "\"1 IN SOA non-sp1 non-sp2 (\" =~ /^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$/" "^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$" nil nil nil nil "1 IN SOA non-sp1 non-sp2 (" nil "1 IN SOA non-sp1 non-sp2 (" ("1" "non-sp1" "non-sp2")) (170 "\"1IN SOA non-sp1 non-sp2(\" =~ /^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$/" "^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$" nil nil nil nil "1IN SOA non-sp1 non-sp2(" nil nil nil) -(171 "\"a.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "a." nil "a." (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(172 "\"Z.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "Z." nil "Z." (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(173 "\"2.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "2." nil "2." (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(174 "\"ab-c.pq-r.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "ab-c.pq-r." nil "ab-c.pq-r." (".pq-r" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(175 "\"sxk.zzz.ac.uk.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "sxk.zzz.ac.uk." nil "sxk.zzz.ac.uk." (".uk" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(176 "\"x-.y-.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "x-.y-." nil "x-.y-." (".y-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(171 "\"a.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "a." nil "a." nil) +(172 "\"Z.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "Z." nil "Z." nil) +(173 "\"2.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "2." nil "2." nil) +(174 "\"ab-c.pq-r.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "ab-c.pq-r." nil "ab-c.pq-r." (".pq-r")) +(175 "\"sxk.zzz.ac.uk.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "sxk.zzz.ac.uk." nil "sxk.zzz.ac.uk." (".uk")) +(176 "\"x-.y-.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "x-.y-." nil "x-.y-." (".y-")) (177 "\"-abc.peq.\" =~ /^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$/" "^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$" nil nil nil nil "-abc.peq." nil nil nil) -(178 "\"*.a\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.a" nil "*.a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(179 "\"*.b0-a\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.b0-a" nil "*.b0-a" ("0-a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(180 "\"*.c3-b.c\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.c3-b.c" nil "*.c3-b.c" ("3-b" ".c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(181 "\"*.c-a.b-c\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.c-a.b-c" nil "*.c-a.b-c" ("-a" ".b-c" "-c" nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(178 "\"*.a\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.a" nil "*.a" nil) +(179 "\"*.b0-a\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.b0-a" nil "*.b0-a" ("0-a")) +(180 "\"*.c3-b.c\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.c3-b.c" nil "*.c3-b.c" ("3-b" ".c")) +(181 "\"*.c-a.b-c\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.c-a.b-c" nil "*.c-a.b-c" ("-a" ".b-c" "-c")) (182 "\"*.0\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.0" nil nil nil) (183 "\"*.a-\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.a-" nil nil nil) (184 "\"*.a-b.c-\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.a-b.c-" nil nil nil) (185 "\"*.c-a.0-c\" =~ /^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$/" "^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$" nil nil nil nil "*.c-a.0-c" nil nil nil) -(186 "\"abde\" =~ /^(?=ab(de))(abd)(e)/" "^(?=ab(de))(abd)(e)" nil nil nil nil "abde" nil "abde" ("de" "abd" "e" nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(187 "\"abdf\" =~ /^(?!(ab)de|x)(abd)(f)/" "^(?!(ab)de|x)(abd)(f)" nil nil nil nil "abdf" nil "abdf" (nil "abd" "f" nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(188 "\"abcd\" =~ /^(?=(ab(cd)))(ab)/" "^(?=(ab(cd)))(ab)" nil nil nil nil "abcd" nil "ab" ("abcd" "cd" "ab" nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(189 "\"a.b.c.d\" =~ /^[\\da-f](\\.[\\da-f])*$/i" "^[\\da-f](\\.[\\da-f])*$" t nil nil nil "a.b.c.d" nil "a.b.c.d" (".d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(190 "\"A.B.C.D\" =~ /^[\\da-f](\\.[\\da-f])*$/i" "^[\\da-f](\\.[\\da-f])*$" t nil nil nil "A.B.C.D" nil "A.B.C.D" (".D" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(191 "\"a.b.c.1.2.3.C\" =~ /^[\\da-f](\\.[\\da-f])*$/i" "^[\\da-f](\\.[\\da-f])*$" t nil nil nil "a.b.c.1.2.3.C" nil "a.b.c.1.2.3.C" (".C" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(192 "\"\\\"1234\\\"\" =~ /^\\\".*\\\"\\s*(;.*)?$/" "^\\\".*\\\"\\s*(;.*)?$" nil nil nil nil "\"1234\"" nil "\"1234\"" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(193 "\"\\\"abcd\\\" ;\" =~ /^\\\".*\\\"\\s*(;.*)?$/" "^\\\".*\\\"\\s*(;.*)?$" nil nil nil nil "\"abcd\" ;" nil "\"abcd\" ;" (";" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(194 "\"\\\"\\\" ; rhubarb\" =~ /^\\\".*\\\"\\s*(;.*)?$/" "^\\\".*\\\"\\s*(;.*)?$" nil nil nil nil "\"\" ; rhubarb" nil "\"\" ; rhubarb" ("; rhubarb" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(186 "\"abde\" =~ /^(?=ab(de))(abd)(e)/" "^(?=ab(de))(abd)(e)" nil nil nil nil "abde" nil "abde" ("de" "abd" "e")) +(187 "\"abdf\" =~ /^(?!(ab)de|x)(abd)(f)/" "^(?!(ab)de|x)(abd)(f)" nil nil nil nil "abdf" nil "abdf" (nil "abd" "f")) +(188 "\"abcd\" =~ /^(?=(ab(cd)))(ab)/" "^(?=(ab(cd)))(ab)" nil nil nil nil "abcd" nil "ab" ("abcd" "cd" "ab")) +(189 "\"a.b.c.d\" =~ /^[\\da-f](\\.[\\da-f])*$/i" "^[\\da-f](\\.[\\da-f])*$" t nil nil nil "a.b.c.d" nil "a.b.c.d" (".d")) +(190 "\"A.B.C.D\" =~ /^[\\da-f](\\.[\\da-f])*$/i" "^[\\da-f](\\.[\\da-f])*$" t nil nil nil "A.B.C.D" nil "A.B.C.D" (".D")) +(191 "\"a.b.c.1.2.3.C\" =~ /^[\\da-f](\\.[\\da-f])*$/i" "^[\\da-f](\\.[\\da-f])*$" t nil nil nil "a.b.c.1.2.3.C" nil "a.b.c.1.2.3.C" (".C")) +(192 "\"\\\"1234\\\"\" =~ /^\\\".*\\\"\\s*(;.*)?$/" "^\\\".*\\\"\\s*(;.*)?$" nil nil nil nil "\"1234\"" nil "\"1234\"" nil) +(193 "\"\\\"abcd\\\" ;\" =~ /^\\\".*\\\"\\s*(;.*)?$/" "^\\\".*\\\"\\s*(;.*)?$" nil nil nil nil "\"abcd\" ;" nil "\"abcd\" ;" (";")) +(194 "\"\\\"\\\" ; rhubarb\" =~ /^\\\".*\\\"\\s*(;.*)?$/" "^\\\".*\\\"\\s*(;.*)?$" nil nil nil nil "\"\" ; rhubarb" nil "\"\" ; rhubarb" ("; rhubarb")) (195 "\"\\\"1234\\\" : things\" =~ /^\\\".*\\\"\\s*(;.*)?$/" "^\\\".*\\\"\\s*(;.*)?$" nil nil nil nil "\"1234\" : things" nil nil nil) -(196 "\"\\\" =~ /^$/" "^$" nil nil nil nil "" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(197 "\"ab c\" =~ / ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)/x" " ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)" nil nil nil t "ab c" nil "ab c" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(196 "\"\\\" =~ /^$/" "^$" nil nil nil nil "" nil "" nil) +(197 "\"ab c\" =~ / ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)/x" " ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)" nil nil nil t "ab c" nil "ab c" nil) (198 "\"abc\" =~ / ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)/x" " ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)" nil nil nil t "abc" nil nil nil) (199 "\"ab cde\" =~ / ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)/x" " ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)" nil nil nil t "ab cde" nil nil nil) -(200 "\"ab c\" =~ /(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)/" "(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)" nil nil nil nil "ab c" nil "ab c" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(200 "\"ab c\" =~ /(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)/" "(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)" nil nil nil nil "ab c" nil "ab c" nil) (201 "\"abc\" =~ /(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)/" "(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)" nil nil nil nil "abc" nil nil nil) (202 "\"ab cde\" =~ /(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)/" "(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)" nil nil nil nil "ab cde" nil nil nil) -(203 "\"a bcd\" =~ /^ a\\ b[c ]d $/x" "^ a\\ b[c ]d $" nil nil nil t "a bcd" nil "a bcd" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(204 "\"a b d\" =~ /^ a\\ b[c ]d $/x" "^ a\\ b[c ]d $" nil nil nil t "a b d" nil "a b d" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(203 "\"a bcd\" =~ /^ a\\ b[c ]d $/x" "^ a\\ b[c ]d $" nil nil nil t "a bcd" nil "a bcd" nil) +(204 "\"a b d\" =~ /^ a\\ b[c ]d $/x" "^ a\\ b[c ]d $" nil nil nil t "a b d" nil "a b d" nil) (205 "\"abcd\" =~ /^ a\\ b[c ]d $/x" "^ a\\ b[c ]d $" nil nil nil t "abcd" nil nil nil) (206 "\"ab d\" =~ /^ a\\ b[c ]d $/x" "^ a\\ b[c ]d $" nil nil nil t "ab d" nil nil nil) -(207 "\"abcdefhijklm\" =~ /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/" "^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$" nil nil nil nil "abcdefhijklm" nil "abcdefhijklm" ("abc" "bc" "c" "def" "ef" "f" "hij" "ij" "j" "klm" "lm" "m" nil nil nil nil)) -(208 "\"abcdefhijklm\" =~ /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/" "^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$" nil nil nil nil "abcdefhijklm" nil "abcdefhijklm" ("bc" "c" "ef" "f" "ij" "j" "lm" "m" nil nil nil nil nil nil nil nil)) -(209 "\"a+ Z0+\\x08\\n\\x1d\\x12\" =~ /^[\\w][\\W][\\s][\\S][\\d][\\D][\\b][\\n][\\c]][\\022]/" "^[\\w][\\W][\\s][\\S][\\d][\\D][\\b][\\n][\\c]][\\022]" nil nil nil nil ("a+ Z0+" 8 10 29 18) nil ("a+ Z0+" 8 10 29 18) (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(210 "\".^\\$(*+)|{?,?}\" =~ /^[.^$|()*+?{,}]+/" "^[.^$|()*+?{,}]+" nil nil nil nil ".^$(*+)|{?,?}" nil ".^$(*+)|{?,?}" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(211 "\"z\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "z" nil "z" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(212 "\"az\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "az" nil "az" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(213 "\"aaaz\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "aaaz" nil "aaaz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(214 "\"a\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "a" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(215 "\"aa\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(216 "\"aaaa\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "aaaa" nil "aaaa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(217 "\"a+\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "a+" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(218 "\"aa+\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "aa+" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(219 "\"z\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "z" nil "z" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(220 "\"az\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "az" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(221 "\"aaaz\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "aaaz" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(222 "\"a\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "a" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(223 "\"aa\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "aa" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(224 "\"aaaa\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "aaaa" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(225 "\"a+\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "a+" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(226 "\"aa+\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "aa+" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(227 "\"az\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "az" nil "az" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(228 "\"aaaz\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "aaaz" nil "aaaz" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(229 "\"aa\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(230 "\"aaaa\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "aaaa" nil "aaaa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(231 "\"aa+\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "aa+" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(232 "\"az\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "az" nil "az" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(233 "\"aaaz\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "aaaz" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(234 "\"aa\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(235 "\"aaaa\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "aaaa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(236 "\"aa+\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "aa+" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(237 "\"1234567890\" =~ /^\\d{8}\\w{2,}/" "^\\d{8}\\w{2,}" nil nil nil nil "1234567890" nil "1234567890" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(238 "\"12345678ab\" =~ /^\\d{8}\\w{2,}/" "^\\d{8}\\w{2,}" nil nil nil nil "12345678ab" nil "12345678ab" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(239 "\"12345678__\" =~ /^\\d{8}\\w{2,}/" "^\\d{8}\\w{2,}" nil nil nil nil "12345678__" nil "12345678__" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(207 "\"abcdefhijklm\" =~ /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/" "^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$" nil nil nil nil "abcdefhijklm" nil "abcdefhijklm" ("abc" "bc" "c" "def" "ef" "f" "hij" "ij" "j" "klm" "lm" "m")) +(208 "\"abcdefhijklm\" =~ /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/" "^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$" nil nil nil nil "abcdefhijklm" nil "abcdefhijklm" ("bc" "c" "ef" "f" "ij" "j" "lm" "m")) +(209 "\"a+ Z0+\\x08\\n\\x1d\\x12\" =~ /^[\\w][\\W][\\s][\\S][\\d][\\D][\\b][\\n][\\c]][\\022]/" "^[\\w][\\W][\\s][\\S][\\d][\\D][\\b][\\n][\\c]][\\022]" nil nil nil nil ("a+ Z0+" 8 10 29 18) nil ("a+ Z0+" 8 10 29 18) nil) +(210 "\".^\\$(*+)|{?,?}\" =~ /^[.^$|()*+?{,}]+/" "^[.^$|()*+?{,}]+" nil nil nil nil ".^$(*+)|{?,?}" nil ".^$(*+)|{?,?}" nil) +(211 "\"z\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "z" nil "z" nil) +(212 "\"az\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "az" nil "az" nil) +(213 "\"aaaz\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "aaaz" nil "aaaz" nil) +(214 "\"a\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "a" nil "a" nil) +(215 "\"aa\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "aa" nil "aa" nil) +(216 "\"aaaa\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "aaaa" nil "aaaa" nil) +(217 "\"a+\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "a+" nil "a" nil) +(218 "\"aa+\" =~ /^a*\\w/" "^a*\\w" nil nil nil nil "aa+" nil "aa" nil) +(219 "\"z\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "z" nil "z" nil) +(220 "\"az\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "az" nil "a" nil) +(221 "\"aaaz\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "aaaz" nil "a" nil) +(222 "\"a\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "a" nil "a" nil) +(223 "\"aa\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "aa" nil "a" nil) +(224 "\"aaaa\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "aaaa" nil "a" nil) +(225 "\"a+\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "a+" nil "a" nil) +(226 "\"aa+\" =~ /^a*?\\w/" "^a*?\\w" nil nil nil nil "aa+" nil "a" nil) +(227 "\"az\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "az" nil "az" nil) +(228 "\"aaaz\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "aaaz" nil "aaaz" nil) +(229 "\"aa\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "aa" nil "aa" nil) +(230 "\"aaaa\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "aaaa" nil "aaaa" nil) +(231 "\"aa+\" =~ /^a+\\w/" "^a+\\w" nil nil nil nil "aa+" nil "aa" nil) +(232 "\"az\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "az" nil "az" nil) +(233 "\"aaaz\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "aaaz" nil "aa" nil) +(234 "\"aa\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "aa" nil "aa" nil) +(235 "\"aaaa\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "aaaa" nil "aa" nil) +(236 "\"aa+\" =~ /^a+?\\w/" "^a+?\\w" nil nil nil nil "aa+" nil "aa" nil) +(237 "\"1234567890\" =~ /^\\d{8}\\w{2,}/" "^\\d{8}\\w{2,}" nil nil nil nil "1234567890" nil "1234567890" nil) +(238 "\"12345678ab\" =~ /^\\d{8}\\w{2,}/" "^\\d{8}\\w{2,}" nil nil nil nil "12345678ab" nil "12345678ab" nil) +(239 "\"12345678__\" =~ /^\\d{8}\\w{2,}/" "^\\d{8}\\w{2,}" nil nil nil nil "12345678__" nil "12345678__" nil) (240 "\"1234567\" =~ /^\\d{8}\\w{2,}/" "^\\d{8}\\w{2,}" nil nil nil nil "1234567" nil nil nil) -(241 "\"uoie\" =~ /^[aeiou\\d]{4,5}$/" "^[aeiou\\d]{4,5}$" nil nil nil nil "uoie" nil "uoie" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(242 "\"1234\" =~ /^[aeiou\\d]{4,5}$/" "^[aeiou\\d]{4,5}$" nil nil nil nil "1234" nil "1234" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(243 "\"12345\" =~ /^[aeiou\\d]{4,5}$/" "^[aeiou\\d]{4,5}$" nil nil nil nil "12345" nil "12345" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(244 "\"aaaaa\" =~ /^[aeiou\\d]{4,5}$/" "^[aeiou\\d]{4,5}$" nil nil nil nil "aaaaa" nil "aaaaa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(241 "\"uoie\" =~ /^[aeiou\\d]{4,5}$/" "^[aeiou\\d]{4,5}$" nil nil nil nil "uoie" nil "uoie" nil) +(242 "\"1234\" =~ /^[aeiou\\d]{4,5}$/" "^[aeiou\\d]{4,5}$" nil nil nil nil "1234" nil "1234" nil) +(243 "\"12345\" =~ /^[aeiou\\d]{4,5}$/" "^[aeiou\\d]{4,5}$" nil nil nil nil "12345" nil "12345" nil) +(244 "\"aaaaa\" =~ /^[aeiou\\d]{4,5}$/" "^[aeiou\\d]{4,5}$" nil nil nil nil "aaaaa" nil "aaaaa" nil) (245 "\"123456\" =~ /^[aeiou\\d]{4,5}$/" "^[aeiou\\d]{4,5}$" nil nil nil nil "123456" nil nil nil) -(246 "\"uoie\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "uoie" nil "uoie" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(247 "\"1234\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "1234" nil "1234" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(248 "\"12345\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "12345" nil "1234" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(249 "\"aaaaa\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "aaaaa" nil "aaaa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(250 "\"123456\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "123456" nil "1234" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(251 "\"abc=abcabc\" =~ /\\A(abc|def)=(\\1){2,3}\\Z/" "\\A(abc|def)=(\\1){2,3}\\Z" nil nil nil nil "abc=abcabc" nil "abc=abcabc" ("abc" "abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(252 "\"def=defdefdef\" =~ /\\A(abc|def)=(\\1){2,3}\\Z/" "\\A(abc|def)=(\\1){2,3}\\Z" nil nil nil nil "def=defdefdef" nil "def=defdefdef" ("def" "def" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(246 "\"uoie\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "uoie" nil "uoie" nil) +(247 "\"1234\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "1234" nil "1234" nil) +(248 "\"12345\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "12345" nil "1234" nil) +(249 "\"aaaaa\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "aaaaa" nil "aaaa" nil) +(250 "\"123456\" =~ /^[aeiou\\d]{4,5}?/" "^[aeiou\\d]{4,5}?" nil nil nil nil "123456" nil "1234" nil) +(251 "\"abc=abcabc\" =~ /\\A(abc|def)=(\\1){2,3}\\Z/" "\\A(abc|def)=(\\1){2,3}\\Z" nil nil nil nil "abc=abcabc" nil "abc=abcabc" ("abc" "abc")) +(252 "\"def=defdefdef\" =~ /\\A(abc|def)=(\\1){2,3}\\Z/" "\\A(abc|def)=(\\1){2,3}\\Z" nil nil nil nil "def=defdefdef" nil "def=defdefdef" ("def" "def")) (253 "\"abc=defdef\" =~ /\\A(abc|def)=(\\1){2,3}\\Z/" "\\A(abc|def)=(\\1){2,3}\\Z" nil nil nil nil "abc=defdef" nil nil nil) -(254 "\"abcdefghijkcda2\" =~ /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$/" "^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$" nil nil nil nil "abcdefghijkcda2" nil "abcdefghijkcda2" ("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "cd" nil nil nil nil)) -(255 "\"abcdefghijkkkkcda2\" =~ /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$/" "^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$" nil nil nil nil "abcdefghijkkkkcda2" nil "abcdefghijkkkkcda2" ("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "cd" nil nil nil nil)) -(256 "\"cataract cataract23\" =~ /(cat(a(ract|tonic)|erpillar)) \\1()2(3)/" "(cat(a(ract|tonic)|erpillar)) \\1()2(3)" nil nil nil nil "cataract cataract23" nil "cataract cataract23" ("cataract" "aract" "ract" "" "3" nil nil nil nil nil nil nil nil nil nil nil)) -(257 "\"catatonic catatonic23\" =~ /(cat(a(ract|tonic)|erpillar)) \\1()2(3)/" "(cat(a(ract|tonic)|erpillar)) \\1()2(3)" nil nil nil nil "catatonic catatonic23" nil "catatonic catatonic23" ("catatonic" "atonic" "tonic" "" "3" nil nil nil nil nil nil nil nil nil nil nil)) -(258 "\"caterpillar caterpillar23\" =~ /(cat(a(ract|tonic)|erpillar)) \\1()2(3)/" "(cat(a(ract|tonic)|erpillar)) \\1()2(3)" nil nil nil nil "caterpillar caterpillar23" nil "caterpillar caterpillar23" ("caterpillar" "erpillar" nil "" "3" nil nil nil nil nil nil nil nil nil nil nil)) +(254 "\"abcdefghijkcda2\" =~ /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$/" "^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$" nil nil nil nil "abcdefghijkcda2" nil "abcdefghijkcda2" ("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "cd")) +(255 "\"abcdefghijkkkkcda2\" =~ /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$/" "^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$" nil nil nil nil "abcdefghijkkkkcda2" nil "abcdefghijkkkkcda2" ("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "cd")) +(256 "\"cataract cataract23\" =~ /(cat(a(ract|tonic)|erpillar)) \\1()2(3)/" "(cat(a(ract|tonic)|erpillar)) \\1()2(3)" nil nil nil nil "cataract cataract23" nil "cataract cataract23" ("cataract" "aract" "ract" "" "3")) +(257 "\"catatonic catatonic23\" =~ /(cat(a(ract|tonic)|erpillar)) \\1()2(3)/" "(cat(a(ract|tonic)|erpillar)) \\1()2(3)" nil nil nil nil "catatonic catatonic23" nil "catatonic catatonic23" ("catatonic" "atonic" "tonic" "" "3")) +(258 "\"caterpillar caterpillar23\" =~ /(cat(a(ract|tonic)|erpillar)) \\1()2(3)/" "(cat(a(ract|tonic)|erpillar)) \\1()2(3)" nil nil nil nil "caterpillar caterpillar23" nil "caterpillar caterpillar23" ("caterpillar" "erpillar" nil "" "3")) (259 "\"From abcd Mon Sep 01 12:33:02 1997\" =~ -/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/" "^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]" nil nil nil nil "From abcd Mon Sep 01 12:33:02 1997" nil "From abcd Mon Sep 01 12:33" ("abcd" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(260 "\"From abcd Mon Sep 01 12:33:02 1997\" =~ /^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d/" "^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d" nil nil nil nil "From abcd Mon Sep 01 12:33:02 1997" nil "From abcd Mon Sep 01 12:33" ("Sep " nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(261 "\"From abcd Mon Sep 1 12:33:02 1997\" =~ /^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d/" "^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d" nil nil nil nil "From abcd Mon Sep 1 12:33:02 1997" nil "From abcd Mon Sep 1 12:33" ("Sep " nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/" "^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]" nil nil nil nil "From abcd Mon Sep 01 12:33:02 1997" nil "From abcd Mon Sep 01 12:33" ("abcd")) +(260 "\"From abcd Mon Sep 01 12:33:02 1997\" =~ /^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d/" "^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d" nil nil nil nil "From abcd Mon Sep 01 12:33:02 1997" nil "From abcd Mon Sep 01 12:33" ("Sep ")) +(261 "\"From abcd Mon Sep 1 12:33:02 1997\" =~ /^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d/" "^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d" nil nil nil nil "From abcd Mon Sep 1 12:33:02 1997" nil "From abcd Mon Sep 1 12:33" ("Sep ")) (262 "\"From abcd Sep 01 12:33:02 1997\" =~ /^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d/" "^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d" nil nil nil nil "From abcd Sep 01 12:33:02 1997" nil nil nil) (263 "\"12\\n34\" =~ /^12.34/s" "^12.34" nil nil t nil "12 34" nil "12 -34" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(264 "\"12\\r34\" =~ /^12.34/s" "^12.34" nil nil t nil ("12" 13 "34") nil ("12" 13 "34") (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(265 "\"the quick brown\\t fox\" =~ /\\w+(?=\\t)/" "\\w+(?=\\t)" nil nil nil nil ("the quick brown" 9 " fox") nil "brown" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(266 "\"foobar is foolish see?\" =~ /foo(?!bar)(.*)/" "foo(?!bar)(.*)" nil nil nil nil "foobar is foolish see?" nil "foolish see?" ("lish see?" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(267 "\"foobar crowbar etc\" =~ /(?:(?!foo)...|^.{0,2})bar(.*)/" "(?:(?!foo)...|^.{0,2})bar(.*)" nil nil nil nil "foobar crowbar etc" nil "rowbar etc" (" etc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(268 "\"barrel\" =~ /(?:(?!foo)...|^.{0,2})bar(.*)/" "(?:(?!foo)...|^.{0,2})bar(.*)" nil nil nil nil "barrel" nil "barrel" ("rel" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(269 "\"2barrel\" =~ /(?:(?!foo)...|^.{0,2})bar(.*)/" "(?:(?!foo)...|^.{0,2})bar(.*)" nil nil nil nil "2barrel" nil "2barrel" ("rel" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(270 "\"A barrel\" =~ /(?:(?!foo)...|^.{0,2})bar(.*)/" "(?:(?!foo)...|^.{0,2})bar(.*)" nil nil nil nil "A barrel" nil "A barrel" ("rel" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(271 "\"abc456\" =~ /^(\\D*)(?=\\d)(?!123)/" "^(\\D*)(?=\\d)(?!123)" nil nil nil nil "abc456" nil "abc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +34" nil) +(264 "\"12\\r34\" =~ /^12.34/s" "^12.34" nil nil t nil ("12" 13 "34") nil ("12" 13 "34") nil) +(265 "\"the quick brown\\t fox\" =~ /\\w+(?=\\t)/" "\\w+(?=\\t)" nil nil nil nil ("the quick brown" 9 " fox") nil "brown" nil) +(266 "\"foobar is foolish see?\" =~ /foo(?!bar)(.*)/" "foo(?!bar)(.*)" nil nil nil nil "foobar is foolish see?" nil "foolish see?" ("lish see?")) +(267 "\"foobar crowbar etc\" =~ /(?:(?!foo)...|^.{0,2})bar(.*)/" "(?:(?!foo)...|^.{0,2})bar(.*)" nil nil nil nil "foobar crowbar etc" nil "rowbar etc" (" etc")) +(268 "\"barrel\" =~ /(?:(?!foo)...|^.{0,2})bar(.*)/" "(?:(?!foo)...|^.{0,2})bar(.*)" nil nil nil nil "barrel" nil "barrel" ("rel")) +(269 "\"2barrel\" =~ /(?:(?!foo)...|^.{0,2})bar(.*)/" "(?:(?!foo)...|^.{0,2})bar(.*)" nil nil nil nil "2barrel" nil "2barrel" ("rel")) +(270 "\"A barrel\" =~ /(?:(?!foo)...|^.{0,2})bar(.*)/" "(?:(?!foo)...|^.{0,2})bar(.*)" nil nil nil nil "A barrel" nil "A barrel" ("rel")) +(271 "\"abc456\" =~ /^(\\D*)(?=\\d)(?!123)/" "^(\\D*)(?=\\d)(?!123)" nil nil nil nil "abc456" nil "abc" ("abc")) (272 "\"abc123\" =~ /^(\\D*)(?=\\d)(?!123)/" "^(\\D*)(?=\\d)(?!123)" nil nil nil nil "abc123" nil nil nil) (273 "\"1234\" =~ /^1234(?# test newlines inside)/" "^1234(?# test newlines - inside)" nil nil nil nil "1234" nil "1234" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) + inside)" nil nil nil nil "1234" nil "1234" nil) (274 "\"1234\" =~ /^1234 #comment in extended re /x" "^1234 #comment in extended re - " nil nil nil t "1234" nil "1234" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) + " nil nil nil t "1234" nil "1234" nil) (275 "\"abcd\" =~ /#rhubarb abcd/x" "#rhubarb - abcd" nil nil nil t "abcd" nil "abcd" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(276 "\"abcd\" =~ /^abcd#rhubarb/x" "^abcd#rhubarb" nil nil nil t "abcd" nil "abcd" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(277 "\"aaab\" =~ /^(a)\\1{2,3}(.)/" "^(a)\\1{2,3}(.)" nil nil nil nil "aaab" nil "aaab" ("a" "b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(278 "\"aaaab\" =~ /^(a)\\1{2,3}(.)/" "^(a)\\1{2,3}(.)" nil nil nil nil "aaaab" nil "aaaab" ("a" "b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(279 "\"aaaaab\" =~ /^(a)\\1{2,3}(.)/" "^(a)\\1{2,3}(.)" nil nil nil nil "aaaaab" nil "aaaaa" ("a" "a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(280 "\"aaaaaab\" =~ /^(a)\\1{2,3}(.)/" "^(a)\\1{2,3}(.)" nil nil nil nil "aaaaaab" nil "aaaaa" ("a" "a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(281 "\"the abc\" =~ /(?!^)abc/" "(?!^)abc" nil nil nil nil "the abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) + abcd" nil nil nil t "abcd" nil "abcd" nil) +(276 "\"abcd\" =~ /^abcd#rhubarb/x" "^abcd#rhubarb" nil nil nil t "abcd" nil "abcd" nil) +(277 "\"aaab\" =~ /^(a)\\1{2,3}(.)/" "^(a)\\1{2,3}(.)" nil nil nil nil "aaab" nil "aaab" ("a" "b")) +(278 "\"aaaab\" =~ /^(a)\\1{2,3}(.)/" "^(a)\\1{2,3}(.)" nil nil nil nil "aaaab" nil "aaaab" ("a" "b")) +(279 "\"aaaaab\" =~ /^(a)\\1{2,3}(.)/" "^(a)\\1{2,3}(.)" nil nil nil nil "aaaaab" nil "aaaaa" ("a" "a")) +(280 "\"aaaaaab\" =~ /^(a)\\1{2,3}(.)/" "^(a)\\1{2,3}(.)" nil nil nil nil "aaaaaab" nil "aaaaa" ("a" "a")) +(281 "\"the abc\" =~ /(?!^)abc/" "(?!^)abc" nil nil nil nil "the abc" nil "abc" nil) (282 "\"abc\" =~ /(?!^)abc/" "(?!^)abc" nil nil nil nil "abc" nil nil nil) -(283 "\"abc\" =~ /(?=^)abc/" "(?=^)abc" nil nil nil nil "abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(283 "\"abc\" =~ /(?=^)abc/" "(?=^)abc" nil nil nil nil "abc" nil "abc" nil) (284 "\"the abc\" =~ /(?=^)abc/" "(?=^)abc" nil nil nil nil "the abc" nil nil nil) -(285 "\"aabbbbb\" =~ /^[ab]{1,3}(ab*|b)/" "^[ab]{1,3}(ab*|b)" nil nil nil nil "aabbbbb" nil "aabb" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(286 "\"aabbbbb\" =~ /^[ab]{1,3}?(ab*|b)/" "^[ab]{1,3}?(ab*|b)" nil nil nil nil "aabbbbb" nil "aabbbbb" ("abbbbb" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(287 "\"aabbbbb\" =~ /^[ab]{1,3}?(ab*?|b)/" "^[ab]{1,3}?(ab*?|b)" nil nil nil nil "aabbbbb" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(288 "\"aabbbbb\" =~ /^[ab]{1,3}(ab*?|b)/" "^[ab]{1,3}(ab*?|b)" nil nil nil nil "aabbbbb" nil "aabb" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(285 "\"aabbbbb\" =~ /^[ab]{1,3}(ab*|b)/" "^[ab]{1,3}(ab*|b)" nil nil nil nil "aabbbbb" nil "aabb" ("b")) +(286 "\"aabbbbb\" =~ /^[ab]{1,3}?(ab*|b)/" "^[ab]{1,3}?(ab*|b)" nil nil nil nil "aabbbbb" nil "aabbbbb" ("abbbbb")) +(287 "\"aabbbbb\" =~ /^[ab]{1,3}?(ab*?|b)/" "^[ab]{1,3}?(ab*?|b)" nil nil nil nil "aabbbbb" nil "aa" ("a")) +(288 "\"aabbbbb\" =~ /^[ab]{1,3}(ab*?|b)/" "^[ab]{1,3}(ab*?|b)" nil nil nil nil "aabbbbb" nil "aabb" ("b")) (289 "\"Alan Other \" =~ / (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional leading comment @@ -681,7 +681,7 @@ ) (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional trailing comment -" nil nil nil t "Alan Other " nil "Alan Other " (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "Alan Other " nil "Alan Other " nil) (290 "\"\" =~ / (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional leading comment @@ -1068,7 +1068,7 @@ ) (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional trailing comment -" nil nil nil t "" nil "user@dom.ain" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "" nil "user@dom.ain" nil) (291 "\"user\\@dom.ain\" =~ / (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional leading comment @@ -1455,7 +1455,7 @@ ) (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional trailing comment -" nil nil nil t "user@dom.ain" nil "user@dom.ain" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "user@dom.ain" nil "user@dom.ain" nil) (292 "\"\\\"A. Other\\\" (a comment)\" =~ / (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional leading comment @@ -1842,7 +1842,7 @@ ) (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional trailing comment -" nil nil nil t "\"A. Other\" (a comment)" nil "\"A. Other\" (a comment)" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "\"A. Other\" (a comment)" nil "\"A. Other\" (a comment)" nil) (293 "\"A. Other (a comment)\" =~ / (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional leading comment @@ -2229,7 +2229,7 @@ ) (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional trailing comment -" nil nil nil t "A. Other (a comment)" nil " Other (a comment)" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "A. Other (a comment)" nil " Other (a comment)" nil) (294 "\"\\\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\\\"\\@x400-re.lay\" =~ / (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional leading comment @@ -2616,7 +2616,7 @@ ) (?: [\\040\\t] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )* \\) )* # optional trailing comment -" nil nil nil t "\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"@x400-re.lay" nil "\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"@x400-re.lay" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"@x400-re.lay" nil "\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"@x400-re.lay" nil) (295 "\"A missing angle # > # name and address ) -" nil nil nil t "Alan Other " nil "Alan Other " (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "Alan Other " nil "Alan Other " nil) (298 "\"\" =~ /[\\040\\t]* # Nab whitespace. (?: \\( # ( @@ -5716,7 +5716,7 @@ > # > # name and address ) -" nil nil nil t "" nil "user@dom.ain" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "" nil "user@dom.ain" nil) (299 "\"user\\@dom.ain\" =~ /[\\040\\t]* # Nab whitespace. (?: \\( # ( @@ -6879,7 +6879,7 @@ > # > # name and address ) -" nil nil nil t "user@dom.ain" nil "user@dom.ain" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "user@dom.ain" nil "user@dom.ain" nil) (300 "\"\\\"A. Other\\\" (a comment)\" =~ /[\\040\\t]* # Nab whitespace. (?: \\( # ( @@ -8042,7 +8042,7 @@ > # > # name and address ) -" nil nil nil t "\"A. Other\" (a comment)" nil "\"A. Other\" " (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "\"A. Other\" (a comment)" nil "\"A. Other\" " nil) (301 "\"A. Other (a comment)\" =~ /[\\040\\t]* # Nab whitespace. (?: \\( # ( @@ -9205,7 +9205,7 @@ > # > # name and address ) -" nil nil nil t "A. Other (a comment)" nil " Other " (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "A. Other (a comment)" nil " Other " nil) (302 "\"\\\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\\\"\\@x400-re.lay\" =~ /[\\040\\t]* # Nab whitespace. (?: \\( # ( @@ -10368,7 +10368,7 @@ > # > # name and address ) -" nil nil nil t "\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"@x400-re.lay" nil "\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"@x400-re.lay" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil nil nil t "\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"@x400-re.lay" nil "\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"@x400-re.lay" nil) (303 "\"A missing angle # > # name and address ) -" nil nil nil t "A missing angle ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255) nil ("" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255) (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(467 "\"xxxxxxxxxxxPSTAIREISLLxxxxxxxxx\" =~ /P[^*]TAIRE[^*]{1,6}?LL/" "P[^*]TAIRE[^*]{1,6}?LL" nil nil nil nil "xxxxxxxxxxxPSTAIREISLLxxxxxxxxx" nil "PSTAIREISLL" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(468 "\"xxxxxxxxxxxPSTAIREISLLxxxxxxxxx\" =~ /P[^*]TAIRE[^*]{1,}?LL/" "P[^*]TAIRE[^*]{1,}?LL" nil nil nil nil "xxxxxxxxxxxPSTAIREISLLxxxxxxxxx" nil "PSTAIREISLL" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(469 "\"1.230003938\" =~ /(\\.\\d\\d[1-9]?)\\d+/" "(\\.\\d\\d[1-9]?)\\d+" nil nil nil nil "1.230003938" nil ".230003938" (".23" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(470 "\"1.875000282\" =~ /(\\.\\d\\d[1-9]?)\\d+/" "(\\.\\d\\d[1-9]?)\\d+" nil nil nil nil "1.875000282" nil ".875000282" (".875" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(471 "\"1.235\" =~ /(\\.\\d\\d[1-9]?)\\d+/" "(\\.\\d\\d[1-9]?)\\d+" nil nil nil nil "1.235" nil ".235" (".23" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(472 "\"1.230003938\" =~ /(\\.\\d\\d((?=0)|\\d(?=\\d)))/" "(\\.\\d\\d((?=0)|\\d(?=\\d)))" nil nil nil nil "1.230003938" nil ".23" (".23" "" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(473 "\"1.875000282\" =~ /(\\.\\d\\d((?=0)|\\d(?=\\d)))/" "(\\.\\d\\d((?=0)|\\d(?=\\d)))" nil nil nil nil "1.875000282" nil ".875" (".875" "5" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(458 "\"aaaabcd\" =~ /[^a]/" "[^a]" nil nil nil nil "aaaabcd" nil "b" nil) +(459 "\"aaAabcd\" =~ /[^a]/" "[^a]" nil nil nil nil "aaAabcd" nil "A" nil) +(460 "\"aaaabcd\" =~ /[^a]/i" "[^a]" t nil nil nil "aaaabcd" nil "b" nil) +(461 "\"aaAabcd\" =~ /[^a]/i" "[^a]" t nil nil nil "aaAabcd" nil "b" nil) +(462 "\"aaaabcd\" =~ /[^az]/" "[^az]" nil nil nil nil "aaaabcd" nil "b" nil) +(463 "\"aaAabcd\" =~ /[^az]/" "[^az]" nil nil nil nil "aaAabcd" nil "A" nil) +(464 "\"aaaabcd\" =~ /[^az]/i" "[^az]" t nil nil nil "aaaabcd" nil "b" nil) +(465 "\"aaAabcd\" =~ /[^az]/i" "[^az]" t nil nil nil "aaAabcd" nil "b" nil) +(466 "\"\\000\\001\\002\\003\\004\\005\\006\\007\\010\\011\\012\\013\\014\\015\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037\\040\\041\\042\\043\\044\\045\\046\\047\\050\\051\\052\\053\\054\\055\\056\\057\\060\\061\\062\\063\\064\\065\\066\\067\\070\\071\\072\\073\\074\\075\\076\\077\\100\\101\\102\\103\\104\\105\\106\\107\\110\\111\\112\\113\\114\\115\\116\\117\\120\\121\\122\\123\\124\\125\\126\\127\\130\\131\\132\\133\\134\\135\\136\\137\\140\\141\\142\\143\\144\\145\\146\\147\\150\\151\\152\\153\\154\\155\\156\\157\\160\\161\\162\\163\\164\\165\\166\\167\\170\\171\\172\\173\\174\\175\\176\\177\\200\\201\\202\\203\\204\\205\\206\\207\\210\\211\\212\\213\\214\\215\\216\\217\\220\\221\\222\\223\\224\\225\\226\\227\\230\\231\\232\\233\\234\\235\\236\\237\\240\\241\\242\\243\\244\\245\\246\\247\\250\\251\\252\\253\\254\\255\\256\\257\\260\\261\\262\\263\\264\\265\\266\\267\\270\\271\\272\\273\\274\\275\\276\\277\\300\\301\\302\\303\\304\\305\\306\\307\\310\\311\\312\\313\\314\\315\\316\\317\\320\\321\\322\\323\\324\\325\\326\\327\\330\\331\\332\\333\\334\\335\\336\\337\\340\\341\\342\\343\\344\\345\\346\\347\\350\\351\\352\\353\\354\\355\\356\\357\\360\\361\\362\\363\\364\\365\\366\\367\\370\\371\\372\\373\\374\\375\\376\\377\" =~ /\\000\\001\\002\\003\\004\\005\\006\\007\\010\\011\\012\\013\\014\\015\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037\\040\\041\\042\\043\\044\\045\\046\\047\\050\\051\\052\\053\\054\\055\\056\\057\\060\\061\\062\\063\\064\\065\\066\\067\\070\\071\\072\\073\\074\\075\\076\\077\\100\\101\\102\\103\\104\\105\\106\\107\\110\\111\\112\\113\\114\\115\\116\\117\\120\\121\\122\\123\\124\\125\\126\\127\\130\\131\\132\\133\\134\\135\\136\\137\\140\\141\\142\\143\\144\\145\\146\\147\\150\\151\\152\\153\\154\\155\\156\\157\\160\\161\\162\\163\\164\\165\\166\\167\\170\\171\\172\\173\\174\\175\\176\\177\\200\\201\\202\\203\\204\\205\\206\\207\\210\\211\\212\\213\\214\\215\\216\\217\\220\\221\\222\\223\\224\\225\\226\\227\\230\\231\\232\\233\\234\\235\\236\\237\\240\\241\\242\\243\\244\\245\\246\\247\\250\\251\\252\\253\\254\\255\\256\\257\\260\\261\\262\\263\\264\\265\\266\\267\\270\\271\\272\\273\\274\\275\\276\\277\\300\\301\\302\\303\\304\\305\\306\\307\\310\\311\\312\\313\\314\\315\\316\\317\\320\\321\\322\\323\\324\\325\\326\\327\\330\\331\\332\\333\\334\\335\\336\\337\\340\\341\\342\\343\\344\\345\\346\\347\\350\\351\\352\\353\\354\\355\\356\\357\\360\\361\\362\\363\\364\\365\\366\\367\\370\\371\\372\\373\\374\\375\\376\\377/" "\\000\\001\\002\\003\\004\\005\\006\\007\\010\\011\\012\\013\\014\\015\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037\\040\\041\\042\\043\\044\\045\\046\\047\\050\\051\\052\\053\\054\\055\\056\\057\\060\\061\\062\\063\\064\\065\\066\\067\\070\\071\\072\\073\\074\\075\\076\\077\\100\\101\\102\\103\\104\\105\\106\\107\\110\\111\\112\\113\\114\\115\\116\\117\\120\\121\\122\\123\\124\\125\\126\\127\\130\\131\\132\\133\\134\\135\\136\\137\\140\\141\\142\\143\\144\\145\\146\\147\\150\\151\\152\\153\\154\\155\\156\\157\\160\\161\\162\\163\\164\\165\\166\\167\\170\\171\\172\\173\\174\\175\\176\\177\\200\\201\\202\\203\\204\\205\\206\\207\\210\\211\\212\\213\\214\\215\\216\\217\\220\\221\\222\\223\\224\\225\\226\\227\\230\\231\\232\\233\\234\\235\\236\\237\\240\\241\\242\\243\\244\\245\\246\\247\\250\\251\\252\\253\\254\\255\\256\\257\\260\\261\\262\\263\\264\\265\\266\\267\\270\\271\\272\\273\\274\\275\\276\\277\\300\\301\\302\\303\\304\\305\\306\\307\\310\\311\\312\\313\\314\\315\\316\\317\\320\\321\\322\\323\\324\\325\\326\\327\\330\\331\\332\\333\\334\\335\\336\\337\\340\\341\\342\\343\\344\\345\\346\\347\\350\\351\\352\\353\\354\\355\\356\\357\\360\\361\\362\\363\\364\\365\\366\\367\\370\\371\\372\\373\\374\\375\\376\\377" nil nil nil nil ("" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255) nil ("" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255) nil) +(467 "\"xxxxxxxxxxxPSTAIREISLLxxxxxxxxx\" =~ /P[^*]TAIRE[^*]{1,6}?LL/" "P[^*]TAIRE[^*]{1,6}?LL" nil nil nil nil "xxxxxxxxxxxPSTAIREISLLxxxxxxxxx" nil "PSTAIREISLL" nil) +(468 "\"xxxxxxxxxxxPSTAIREISLLxxxxxxxxx\" =~ /P[^*]TAIRE[^*]{1,}?LL/" "P[^*]TAIRE[^*]{1,}?LL" nil nil nil nil "xxxxxxxxxxxPSTAIREISLLxxxxxxxxx" nil "PSTAIREISLL" nil) +(469 "\"1.230003938\" =~ /(\\.\\d\\d[1-9]?)\\d+/" "(\\.\\d\\d[1-9]?)\\d+" nil nil nil nil "1.230003938" nil ".230003938" (".23")) +(470 "\"1.875000282\" =~ /(\\.\\d\\d[1-9]?)\\d+/" "(\\.\\d\\d[1-9]?)\\d+" nil nil nil nil "1.875000282" nil ".875000282" (".875")) +(471 "\"1.235\" =~ /(\\.\\d\\d[1-9]?)\\d+/" "(\\.\\d\\d[1-9]?)\\d+" nil nil nil nil "1.235" nil ".235" (".23")) +(472 "\"1.230003938\" =~ /(\\.\\d\\d((?=0)|\\d(?=\\d)))/" "(\\.\\d\\d((?=0)|\\d(?=\\d)))" nil nil nil nil "1.230003938" nil ".23" (".23" "")) +(473 "\"1.875000282\" =~ /(\\.\\d\\d((?=0)|\\d(?=\\d)))/" "(\\.\\d\\d((?=0)|\\d(?=\\d)))" nil nil nil nil "1.875000282" nil ".875" (".875" "5")) (474 "\"1.235\" =~ /(\\.\\d\\d((?=0)|\\d(?=\\d)))/" "(\\.\\d\\d((?=0)|\\d(?=\\d)))" nil nil nil nil "1.235" nil nil nil) -(475 "\"ab\" =~ /a(?)b/" "a(?)b" nil nil nil nil "ab" nil "ab" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(476 "\"Food is on the foo table\" =~ /\\b(foo)\\s+(\\w+)/i" "\\b(foo)\\s+(\\w+)" t nil nil nil "Food is on the foo table" nil "foo table" ("foo" "table" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(477 "\"The food is under the bar in the barn.\" =~ /foo(.*)bar/" "foo(.*)bar" nil nil nil nil "The food is under the bar in the barn." nil "food is under the bar in the bar" ("d is under the bar in the " nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(478 "\"The food is under the bar in the barn.\" =~ /foo(.*?)bar/" "foo(.*?)bar" nil nil nil nil "The food is under the bar in the barn." nil "food is under the bar" ("d is under the " nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(479 "\"I have 2 numbers: 53147\" =~ /(.*)(\\d*)/" "(.*)(\\d*)" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: 53147" "" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(480 "\"I have 2 numbers: 53147\" =~ /(.*)(\\d+)/" "(.*)(\\d+)" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: 5314" "7" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(481 "\"I have 2 numbers: 53147\" =~ /(.*?)(\\d*)/" "(.*?)(\\d*)" nil nil nil nil "I have 2 numbers: 53147" nil "" ("" "" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(482 "\"I have 2 numbers: 53147\" =~ /(.*?)(\\d+)/" "(.*?)(\\d+)" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2" ("I have " "2" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(483 "\"I have 2 numbers: 53147\" =~ /(.*)(\\d+)$/" "(.*)(\\d+)$" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: 5314" "7" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(484 "\"I have 2 numbers: 53147\" =~ /(.*?)(\\d+)$/" "(.*?)(\\d+)$" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: " "53147" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(485 "\"I have 2 numbers: 53147\" =~ /(.*)\\b(\\d+)$/" "(.*)\\b(\\d+)$" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: " "53147" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(486 "\"I have 2 numbers: 53147\" =~ /(.*\\D)(\\d+)$/" "(.*\\D)(\\d+)$" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: " "53147" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(487 "\"ABC123\" =~ /^\\D*(?!123)/" "^\\D*(?!123)" nil nil nil nil "ABC123" nil "AB" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(488 "\"ABC445\" =~ /^(\\D*)(?=\\d)(?!123)/" "^(\\D*)(?=\\d)(?!123)" nil nil nil nil "ABC445" nil "ABC" ("ABC" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(475 "\"ab\" =~ /a(?)b/" "a(?)b" nil nil nil nil "ab" nil "ab" nil) +(476 "\"Food is on the foo table\" =~ /\\b(foo)\\s+(\\w+)/i" "\\b(foo)\\s+(\\w+)" t nil nil nil "Food is on the foo table" nil "foo table" ("foo" "table")) +(477 "\"The food is under the bar in the barn.\" =~ /foo(.*)bar/" "foo(.*)bar" nil nil nil nil "The food is under the bar in the barn." nil "food is under the bar in the bar" ("d is under the bar in the ")) +(478 "\"The food is under the bar in the barn.\" =~ /foo(.*?)bar/" "foo(.*?)bar" nil nil nil nil "The food is under the bar in the barn." nil "food is under the bar" ("d is under the ")) +(479 "\"I have 2 numbers: 53147\" =~ /(.*)(\\d*)/" "(.*)(\\d*)" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: 53147" "")) +(480 "\"I have 2 numbers: 53147\" =~ /(.*)(\\d+)/" "(.*)(\\d+)" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: 5314" "7")) +(481 "\"I have 2 numbers: 53147\" =~ /(.*?)(\\d*)/" "(.*?)(\\d*)" nil nil nil nil "I have 2 numbers: 53147" nil "" ("" "")) +(482 "\"I have 2 numbers: 53147\" =~ /(.*?)(\\d+)/" "(.*?)(\\d+)" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2" ("I have " "2")) +(483 "\"I have 2 numbers: 53147\" =~ /(.*)(\\d+)$/" "(.*)(\\d+)$" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: 5314" "7")) +(484 "\"I have 2 numbers: 53147\" =~ /(.*?)(\\d+)$/" "(.*?)(\\d+)$" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: " "53147")) +(485 "\"I have 2 numbers: 53147\" =~ /(.*)\\b(\\d+)$/" "(.*)\\b(\\d+)$" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: " "53147")) +(486 "\"I have 2 numbers: 53147\" =~ /(.*\\D)(\\d+)$/" "(.*\\D)(\\d+)$" nil nil nil nil "I have 2 numbers: 53147" nil "I have 2 numbers: 53147" ("I have 2 numbers: " "53147")) +(487 "\"ABC123\" =~ /^\\D*(?!123)/" "^\\D*(?!123)" nil nil nil nil "ABC123" nil "AB" nil) +(488 "\"ABC445\" =~ /^(\\D*)(?=\\d)(?!123)/" "^(\\D*)(?=\\d)(?!123)" nil nil nil nil "ABC445" nil "ABC" ("ABC")) (489 "\"ABC123\" =~ /^(\\D*)(?=\\d)(?!123)/" "^(\\D*)(?=\\d)(?!123)" nil nil nil nil "ABC123" nil nil nil) -(490 "\"W46]789\" =~ /^[W-]46]/" "^[W-]46]" nil nil nil nil "W46]789" nil "W46]" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(491 "\"-46]789\" =~ /^[W-]46]/" "^[W-]46]" nil nil nil nil "-46]789" nil "-46]" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(490 "\"W46]789\" =~ /^[W-]46]/" "^[W-]46]" nil nil nil nil "W46]789" nil "W46]" nil) +(491 "\"-46]789\" =~ /^[W-]46]/" "^[W-]46]" nil nil nil nil "-46]789" nil "-46]" nil) (492 "\"Wall\" =~ /^[W-]46]/" "^[W-]46]" nil nil nil nil "Wall" nil nil nil) (493 "\"Zebra\" =~ /^[W-]46]/" "^[W-]46]" nil nil nil nil "Zebra" nil nil nil) (494 "\"42\" =~ /^[W-]46]/" "^[W-]46]" nil nil nil nil "42" nil nil nil) (495 "\"[abcd]\" =~ /^[W-]46]/" "^[W-]46]" nil nil nil nil "[abcd]" nil nil nil) (496 "\"]abcd[\" =~ /^[W-]46]/" "^[W-]46]" nil nil nil nil "]abcd[" nil nil nil) -(497 "\"W46]789\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "W46]789" nil "W" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(498 "\"Wall\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "Wall" nil "W" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(499 "\"Zebra\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "Zebra" nil "Z" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(500 "\"Xylophone\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "Xylophone" nil "X" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(501 "\"42\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "42" nil "4" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(502 "\"[abcd]\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "[abcd]" nil "[" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(503 "\"]abcd[\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "]abcd[" nil "]" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(504 "\"\\\\backslash\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "\\backslash" nil "\\" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(497 "\"W46]789\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "W46]789" nil "W" nil) +(498 "\"Wall\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "Wall" nil "W" nil) +(499 "\"Zebra\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "Zebra" nil "Z" nil) +(500 "\"Xylophone\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "Xylophone" nil "X" nil) +(501 "\"42\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "42" nil "4" nil) +(502 "\"[abcd]\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "[abcd]" nil "[" nil) +(503 "\"]abcd[\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "]abcd[" nil "]" nil) +(504 "\"\\\\backslash\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "\\backslash" nil "\\" nil) (505 "\"-46]789\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "-46]789" nil nil nil) (506 "\"well\" =~ /^[W-\\]46]/" "^[W-\\]46]" nil nil nil nil "well" nil nil nil) -(507 "\"01/01/2000\" =~ /\\d\\d\\/\\d\\d\\/\\d\\d\\d\\d/" "\\d\\d\\/\\d\\d\\/\\d\\d\\d\\d" nil nil nil nil "01/01/2000" nil "01/01/2000" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(508 "\"word cat dog elephant mussel cow horse canary baboon snake shark otherword\" =~ /word (?:[a-zA-Z0-9]+ ){0,10}otherword/" "word (?:[a-zA-Z0-9]+ ){0,10}otherword" nil nil nil nil "word cat dog elephant mussel cow horse canary baboon snake shark otherword" nil "word cat dog elephant mussel cow horse canary baboon snake shark otherword" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(507 "\"01/01/2000\" =~ /\\d\\d\\/\\d\\d\\/\\d\\d\\d\\d/" "\\d\\d\\/\\d\\d\\/\\d\\d\\d\\d" nil nil nil nil "01/01/2000" nil "01/01/2000" nil) +(508 "\"word cat dog elephant mussel cow horse canary baboon snake shark otherword\" =~ /word (?:[a-zA-Z0-9]+ ){0,10}otherword/" "word (?:[a-zA-Z0-9]+ ){0,10}otherword" nil nil nil nil "word cat dog elephant mussel cow horse canary baboon snake shark otherword" nil "word cat dog elephant mussel cow horse canary baboon snake shark otherword" nil) (509 "\"word cat dog elephant mussel cow horse canary baboon snake shark\" =~ /word (?:[a-zA-Z0-9]+ ){0,10}otherword/" "word (?:[a-zA-Z0-9]+ ){0,10}otherword" nil nil nil nil "word cat dog elephant mussel cow horse canary baboon snake shark" nil nil nil) (510 "\"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope\" =~ /word (?:[a-zA-Z0-9]+ ){0,300}otherword/" "word (?:[a-zA-Z0-9]+ ){0,300}otherword" nil nil nil nil "word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope" nil nil nil) -(511 "\"bcd\" =~ /^(a){0,0}/" "^(a){0,0}" nil nil nil nil "bcd" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(512 "\"abc\" =~ /^(a){0,0}/" "^(a){0,0}" nil nil nil nil "abc" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(513 "\"aab\" =~ /^(a){0,0}/" "^(a){0,0}" nil nil nil nil "aab" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(514 "\"bcd\" =~ /^(a){0,1}/" "^(a){0,1}" nil nil nil nil "bcd" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(515 "\"abc\" =~ /^(a){0,1}/" "^(a){0,1}" nil nil nil nil "abc" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(516 "\"aab\" =~ /^(a){0,1}/" "^(a){0,1}" nil nil nil nil "aab" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(517 "\"bcd\" =~ /^(a){0,2}/" "^(a){0,2}" nil nil nil nil "bcd" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(518 "\"abc\" =~ /^(a){0,2}/" "^(a){0,2}" nil nil nil nil "abc" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(519 "\"aab\" =~ /^(a){0,2}/" "^(a){0,2}" nil nil nil nil "aab" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(520 "\"bcd\" =~ /^(a){0,3}/" "^(a){0,3}" nil nil nil nil "bcd" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(521 "\"abc\" =~ /^(a){0,3}/" "^(a){0,3}" nil nil nil nil "abc" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(522 "\"aab\" =~ /^(a){0,3}/" "^(a){0,3}" nil nil nil nil "aab" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(523 "\"aaa\" =~ /^(a){0,3}/" "^(a){0,3}" nil nil nil nil "aaa" nil "aaa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(524 "\"bcd\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "bcd" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(525 "\"abc\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "abc" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(526 "\"aab\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "aab" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(527 "\"aaa\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "aaa" nil "aaa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(528 "\"aaaaaaaa\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "aaaaaaaa" nil "aaaaaaaa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(511 "\"bcd\" =~ /^(a){0,0}/" "^(a){0,0}" nil nil nil nil "bcd" nil "" nil) +(512 "\"abc\" =~ /^(a){0,0}/" "^(a){0,0}" nil nil nil nil "abc" nil "" nil) +(513 "\"aab\" =~ /^(a){0,0}/" "^(a){0,0}" nil nil nil nil "aab" nil "" nil) +(514 "\"bcd\" =~ /^(a){0,1}/" "^(a){0,1}" nil nil nil nil "bcd" nil "" nil) +(515 "\"abc\" =~ /^(a){0,1}/" "^(a){0,1}" nil nil nil nil "abc" nil "a" ("a")) +(516 "\"aab\" =~ /^(a){0,1}/" "^(a){0,1}" nil nil nil nil "aab" nil "a" ("a")) +(517 "\"bcd\" =~ /^(a){0,2}/" "^(a){0,2}" nil nil nil nil "bcd" nil "" nil) +(518 "\"abc\" =~ /^(a){0,2}/" "^(a){0,2}" nil nil nil nil "abc" nil "a" ("a")) +(519 "\"aab\" =~ /^(a){0,2}/" "^(a){0,2}" nil nil nil nil "aab" nil "aa" ("a")) +(520 "\"bcd\" =~ /^(a){0,3}/" "^(a){0,3}" nil nil nil nil "bcd" nil "" nil) +(521 "\"abc\" =~ /^(a){0,3}/" "^(a){0,3}" nil nil nil nil "abc" nil "a" ("a")) +(522 "\"aab\" =~ /^(a){0,3}/" "^(a){0,3}" nil nil nil nil "aab" nil "aa" ("a")) +(523 "\"aaa\" =~ /^(a){0,3}/" "^(a){0,3}" nil nil nil nil "aaa" nil "aaa" ("a")) +(524 "\"bcd\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "bcd" nil "" nil) +(525 "\"abc\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "abc" nil "a" ("a")) +(526 "\"aab\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "aab" nil "aa" ("a")) +(527 "\"aaa\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "aaa" nil "aaa" ("a")) +(528 "\"aaaaaaaa\" =~ /^(a){0,}/" "^(a){0,}" nil nil nil nil "aaaaaaaa" nil "aaaaaaaa" ("a")) (529 "\"bcd\" =~ /^(a){1,1}/" "^(a){1,1}" nil nil nil nil "bcd" nil nil nil) -(530 "\"abc\" =~ /^(a){1,1}/" "^(a){1,1}" nil nil nil nil "abc" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(531 "\"aab\" =~ /^(a){1,1}/" "^(a){1,1}" nil nil nil nil "aab" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(530 "\"abc\" =~ /^(a){1,1}/" "^(a){1,1}" nil nil nil nil "abc" nil "a" ("a")) +(531 "\"aab\" =~ /^(a){1,1}/" "^(a){1,1}" nil nil nil nil "aab" nil "a" ("a")) (532 "\"bcd\" =~ /^(a){1,2}/" "^(a){1,2}" nil nil nil nil "bcd" nil nil nil) -(533 "\"abc\" =~ /^(a){1,2}/" "^(a){1,2}" nil nil nil nil "abc" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(534 "\"aab\" =~ /^(a){1,2}/" "^(a){1,2}" nil nil nil nil "aab" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(533 "\"abc\" =~ /^(a){1,2}/" "^(a){1,2}" nil nil nil nil "abc" nil "a" ("a")) +(534 "\"aab\" =~ /^(a){1,2}/" "^(a){1,2}" nil nil nil nil "aab" nil "aa" ("a")) (535 "\"bcd\" =~ /^(a){1,3}/" "^(a){1,3}" nil nil nil nil "bcd" nil nil nil) -(536 "\"abc\" =~ /^(a){1,3}/" "^(a){1,3}" nil nil nil nil "abc" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(537 "\"aab\" =~ /^(a){1,3}/" "^(a){1,3}" nil nil nil nil "aab" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(538 "\"aaa\" =~ /^(a){1,3}/" "^(a){1,3}" nil nil nil nil "aaa" nil "aaa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(536 "\"abc\" =~ /^(a){1,3}/" "^(a){1,3}" nil nil nil nil "abc" nil "a" ("a")) +(537 "\"aab\" =~ /^(a){1,3}/" "^(a){1,3}" nil nil nil nil "aab" nil "aa" ("a")) +(538 "\"aaa\" =~ /^(a){1,3}/" "^(a){1,3}" nil nil nil nil "aaa" nil "aaa" ("a")) (539 "\"bcd\" =~ /^(a){1,}/" "^(a){1,}" nil nil nil nil "bcd" nil nil nil) -(540 "\"abc\" =~ /^(a){1,}/" "^(a){1,}" nil nil nil nil "abc" nil "a" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(541 "\"aab\" =~ /^(a){1,}/" "^(a){1,}" nil nil nil nil "aab" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(542 "\"aaa\" =~ /^(a){1,}/" "^(a){1,}" nil nil nil nil "aaa" nil "aaa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(543 "\"aaaaaaaa\" =~ /^(a){1,}/" "^(a){1,}" nil nil nil nil "aaaaaaaa" nil "aaaaaaaa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(540 "\"abc\" =~ /^(a){1,}/" "^(a){1,}" nil nil nil nil "abc" nil "a" ("a")) +(541 "\"aab\" =~ /^(a){1,}/" "^(a){1,}" nil nil nil nil "aab" nil "aa" ("a")) +(542 "\"aaa\" =~ /^(a){1,}/" "^(a){1,}" nil nil nil nil "aaa" nil "aaa" ("a")) +(543 "\"aaaaaaaa\" =~ /^(a){1,}/" "^(a){1,}" nil nil nil nil "aaaaaaaa" nil "aaaaaaaa" ("a")) (544 "\"borfle\\nbib.gif\\nno\" =~ /.*\\.gif/" ".*\\.gif" nil nil nil nil "borfle bib.gif -no" nil "bib.gif" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +no" nil "bib.gif" nil) (545 "\"borfle\\nbib.gif\\nno\" =~ /.{0,}\\.gif/" ".{0,}\\.gif" nil nil nil nil "borfle bib.gif -no" nil "bib.gif" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +no" nil "bib.gif" nil) (546 "\"borfle\\nbib.gif\\nno\" =~ /.*\\.gif/m" ".*\\.gif" nil t nil nil "borfle bib.gif -no" nil "bib.gif" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +no" nil "bib.gif" nil) (547 "\"borfle\\nbib.gif\\nno\" =~ /.*\\.gif/s" ".*\\.gif" nil nil t nil "borfle bib.gif no" nil "borfle -bib.gif" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +bib.gif" nil) (548 "\"borfle\\nbib.gif\\nno\" =~ /.*\\.gif/ms" ".*\\.gif" nil t t nil "borfle bib.gif no" nil "borfle -bib.gif" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +bib.gif" nil) (549 "\"borfle\\nbib.gif\\nno\" =~ /.*$/" ".*$" nil nil nil nil "borfle bib.gif -no" nil "no" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +no" nil "no" nil) (550 "\"borfle\\nbib.gif\\nno\" =~ /.*$/m" ".*$" nil t nil nil "borfle bib.gif -no" nil "borfle" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +no" nil "borfle" nil) (551 "\"borfle\\nbib.gif\\nno\" =~ /.*$/s" ".*$" nil nil t nil "borfle bib.gif no" nil "borfle bib.gif -no" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +no" nil) (552 "\"borfle\\nbib.gif\\nno\" =~ /.*$/ms" ".*$" nil t t nil "borfle bib.gif no" nil "borfle bib.gif -no" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +no" nil) (553 "\"borfle\\nbib.gif\\nno\\n\" =~ /.*$/" ".*$" nil nil nil nil "borfle bib.gif no -" nil "no" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil "no" nil) (554 "\"borfle\\nbib.gif\\nno\\n\" =~ /.*$/m" ".*$" nil t nil nil "borfle bib.gif no -" nil "borfle" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil "borfle" nil) (555 "\"borfle\\nbib.gif\\nno\\n\" =~ /.*$/s" ".*$" nil nil t nil "borfle bib.gif no " nil "borfle bib.gif no -" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil) (556 "\"borfle\\nbib.gif\\nno\\n\" =~ /.*$/ms" ".*$" nil t t nil "borfle bib.gif no " nil "borfle bib.gif no -" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil) (557 "\"abcde\\n1234Xyz\" =~ /(.*X|^B)/" "(.*X|^B)" nil nil nil nil "abcde -1234Xyz" nil "1234X" ("1234X" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(558 "\"BarFoo\" =~ /(.*X|^B)/" "(.*X|^B)" nil nil nil nil "BarFoo" nil "B" ("B" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +1234Xyz" nil "1234X" ("1234X")) +(558 "\"BarFoo\" =~ /(.*X|^B)/" "(.*X|^B)" nil nil nil nil "BarFoo" nil "B" ("B")) (559 "\"abcde\\nBar\" =~ /(.*X|^B)/" "(.*X|^B)" nil nil nil nil "abcde Bar" nil nil nil) (560 "\"abcde\\n1234Xyz\" =~ /(.*X|^B)/m" "(.*X|^B)" nil t nil nil "abcde -1234Xyz" nil "1234X" ("1234X" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(561 "\"BarFoo\" =~ /(.*X|^B)/m" "(.*X|^B)" nil t nil nil "BarFoo" nil "B" ("B" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +1234Xyz" nil "1234X" ("1234X")) +(561 "\"BarFoo\" =~ /(.*X|^B)/m" "(.*X|^B)" nil t nil nil "BarFoo" nil "B" ("B")) (562 "\"abcde\\nBar\" =~ /(.*X|^B)/m" "(.*X|^B)" nil t nil nil "abcde -Bar" nil "B" ("B" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +Bar" nil "B" ("B")) (563 "\"abcde\\n1234Xyz\" =~ /(.*X|^B)/s" "(.*X|^B)" nil nil t nil "abcde 1234Xyz" nil "abcde 1234X" ("abcde -1234X" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(564 "\"BarFoo\" =~ /(.*X|^B)/s" "(.*X|^B)" nil nil t nil "BarFoo" nil "B" ("B" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +1234X")) +(564 "\"BarFoo\" =~ /(.*X|^B)/s" "(.*X|^B)" nil nil t nil "BarFoo" nil "B" ("B")) (565 "\"abcde\\nBar\" =~ /(.*X|^B)/s" "(.*X|^B)" nil nil t nil "abcde Bar" nil nil nil) (566 "\"abcde\\n1234Xyz\" =~ /(.*X|^B)/ms" "(.*X|^B)" nil t t nil "abcde 1234Xyz" nil "abcde 1234X" ("abcde -1234X" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(567 "\"BarFoo\" =~ /(.*X|^B)/ms" "(.*X|^B)" nil t t nil "BarFoo" nil "B" ("B" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +1234X")) +(567 "\"BarFoo\" =~ /(.*X|^B)/ms" "(.*X|^B)" nil t t nil "BarFoo" nil "B" ("B")) (568 "\"abcde\\nBar\" =~ /(.*X|^B)/ms" "(.*X|^B)" nil t t nil "abcde -Bar" nil "B" ("B" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +Bar" nil "B" ("B")) (569 "\"abcde\\n1234Xyz\" =~ /(?s)(.*X|^B)/" "(?s)(.*X|^B)" nil nil nil nil "abcde 1234Xyz" nil "abcde 1234X" ("abcde -1234X" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(570 "\"BarFoo\" =~ /(?s)(.*X|^B)/" "(?s)(.*X|^B)" nil nil nil nil "BarFoo" nil "B" ("B" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +1234X")) +(570 "\"BarFoo\" =~ /(?s)(.*X|^B)/" "(?s)(.*X|^B)" nil nil nil nil "BarFoo" nil "B" ("B")) (571 "\"abcde\\nBar\" =~ /(?s)(.*X|^B)/" "(?s)(.*X|^B)" nil nil nil nil "abcde Bar" nil nil nil) (572 "\"abcde\\n1234Xyz\" =~ /(?s:.*X|^B)/" "(?s:.*X|^B)" nil nil nil nil "abcde 1234Xyz" nil "abcde -1234X" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(573 "\"BarFoo\" =~ /(?s:.*X|^B)/" "(?s:.*X|^B)" nil nil nil nil "BarFoo" nil "B" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +1234X" nil) +(573 "\"BarFoo\" =~ /(?s:.*X|^B)/" "(?s:.*X|^B)" nil nil nil nil "BarFoo" nil "B" nil) (574 "\"abcde\\nBar\" =~ /(?s:.*X|^B)/" "(?s:.*X|^B)" nil nil nil nil "abcde Bar" nil nil nil) (575 "\"abc\\nB\" =~ /^.*B/" "^.*B" nil nil nil nil "abc B" nil nil nil) (576 "\"abc\\nB\" =~ /(?s)^.*B/" "(?s)^.*B" nil nil nil nil "abc B" nil "abc -B" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +B" nil) (577 "\"abc\\nB\" =~ /(?m)^.*B/" "(?m)^.*B" nil nil nil nil "abc -B" nil "B" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +B" nil "B" nil) (578 "\"abc\\nB\" =~ /(?ms)^.*B/" "(?ms)^.*B" nil nil nil nil "abc B" nil "abc -B" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +B" nil) (579 "\"abc\\nB\" =~ /(?ms)^B/" "(?ms)^B" nil nil nil nil "abc -B" nil "B" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +B" nil "B" nil) (580 "\"B\\n\" =~ /(?s)B$/" "(?s)B$" nil nil nil nil "B -" nil "B" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(581 "\"123456654321\" =~ /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/" "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]" nil nil nil nil "123456654321" nil "123456654321" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(582 "\"123456654321\" =~ /^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d/" "^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d" nil nil nil nil "123456654321" nil "123456654321" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(583 "\"123456654321\" =~ /^[\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d]/" "^[\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d]" nil nil nil nil "123456654321" nil "123456654321" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(584 "\"abcabcabcabc\" =~ /^[abc]{12}/" "^[abc]{12}" nil nil nil nil "abcabcabcabc" nil "abcabcabcabc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(585 "\"abcabcabcabc\" =~ /^[a-c]{12}/" "^[a-c]{12}" nil nil nil nil "abcabcabcabc" nil "abcabcabcabc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(586 "\"abcabcabcabc\" =~ /^(a|b|c){12}/" "^(a|b|c){12}" nil nil nil nil "abcabcabcabc" nil "abcabcabcabc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(587 "\"n\" =~ /^[abcdefghijklmnopqrstuvwxy0123456789]/" "^[abcdefghijklmnopqrstuvwxy0123456789]" nil nil nil nil "n" nil "n" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil "B" nil) +(581 "\"123456654321\" =~ /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/" "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]" nil nil nil nil "123456654321" nil "123456654321" nil) +(582 "\"123456654321\" =~ /^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d/" "^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d" nil nil nil nil "123456654321" nil "123456654321" nil) +(583 "\"123456654321\" =~ /^[\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d]/" "^[\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d]" nil nil nil nil "123456654321" nil "123456654321" nil) +(584 "\"abcabcabcabc\" =~ /^[abc]{12}/" "^[abc]{12}" nil nil nil nil "abcabcabcabc" nil "abcabcabcabc" nil) +(585 "\"abcabcabcabc\" =~ /^[a-c]{12}/" "^[a-c]{12}" nil nil nil nil "abcabcabcabc" nil "abcabcabcabc" nil) +(586 "\"abcabcabcabc\" =~ /^(a|b|c){12}/" "^(a|b|c){12}" nil nil nil nil "abcabcabcabc" nil "abcabcabcabc" ("c")) +(587 "\"n\" =~ /^[abcdefghijklmnopqrstuvwxy0123456789]/" "^[abcdefghijklmnopqrstuvwxy0123456789]" nil nil nil nil "n" nil "n" nil) (588 "\"z\" =~ /^[abcdefghijklmnopqrstuvwxy0123456789]/" "^[abcdefghijklmnopqrstuvwxy0123456789]" nil nil nil nil "z" nil nil nil) -(589 "\"abcd\" =~ /abcde{0,0}/" "abcde{0,0}" nil nil nil nil "abcd" nil "abcd" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(589 "\"abcd\" =~ /abcde{0,0}/" "abcde{0,0}" nil nil nil nil "abcd" nil "abcd" nil) (590 "\"abce\" =~ /abcde{0,0}/" "abcde{0,0}" nil nil nil nil "abce" nil nil nil) -(591 "\"abe\" =~ /ab[cd]{0,0}e/" "ab[cd]{0,0}e" nil nil nil nil "abe" nil "abe" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(591 "\"abe\" =~ /ab[cd]{0,0}e/" "ab[cd]{0,0}e" nil nil nil nil "abe" nil "abe" nil) (592 "\"abcde\" =~ /ab[cd]{0,0}e/" "ab[cd]{0,0}e" nil nil nil nil "abcde" nil nil nil) -(593 "\"abd\" =~ /ab(c){0,0}d/" "ab(c){0,0}d" nil nil nil nil "abd" nil "abd" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(593 "\"abd\" =~ /ab(c){0,0}d/" "ab(c){0,0}d" nil nil nil nil "abd" nil "abd" nil) (594 "\"abcd\" =~ /ab(c){0,0}d/" "ab(c){0,0}d" nil nil nil nil "abcd" nil nil nil) -(595 "\"a\" =~ /a(b*)/" "a(b*)" nil nil nil nil "a" nil "a" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(596 "\"ab\" =~ /a(b*)/" "a(b*)" nil nil nil nil "ab" nil "ab" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(597 "\"abbbb\" =~ /a(b*)/" "a(b*)" nil nil nil nil "abbbb" nil "abbbb" ("bbbb" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(595 "\"a\" =~ /a(b*)/" "a(b*)" nil nil nil nil "a" nil "a" ("")) +(596 "\"ab\" =~ /a(b*)/" "a(b*)" nil nil nil nil "ab" nil "ab" ("b")) +(597 "\"abbbb\" =~ /a(b*)/" "a(b*)" nil nil nil nil "abbbb" nil "abbbb" ("bbbb")) (598 "\"bbbbb\" =~ /a(b*)/" "a(b*)" nil nil nil nil "bbbbb" nil nil nil) -(599 "\"abe\" =~ /ab\\d{0}e/" "ab\\d{0}e" nil nil nil nil "abe" nil "abe" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(599 "\"abe\" =~ /ab\\d{0}e/" "ab\\d{0}e" nil nil nil nil "abe" nil "abe" nil) (600 "\"ab1e\" =~ /ab\\d{0}e/" "ab\\d{0}e" nil nil nil nil "ab1e" nil nil nil) -(601 "\"the \\\"quick\\\" brown fox\" =~ /\"([^\\\\\"]+|\\\\.)*\"/" "\"([^\\\\\"]+|\\\\.)*\"" nil nil nil nil "the \"quick\" brown fox" nil "\"quick\"" ("quick" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(602 "\"\\\"the \\\\\\\"quick\\\\\\\" brown fox\\\"\" =~ /\"([^\\\\\"]+|\\\\.)*\"/" "\"([^\\\\\"]+|\\\\.)*\"" nil nil nil nil "\"the \\\"quick\\\" brown fox\"" nil "\"the \\\"quick\\\" brown fox\"" (" brown fox" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(603 "\"abc\" =~ /.*?/" ".*?" nil nil nil nil "abc" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(604 "\"abc\" =~ /\\b/" "\\b" nil nil nil nil "abc" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(605 "\"abc\" =~ /\\b/" "\\b" nil nil nil nil "abc" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(606 "\"abc\" =~ /(?#)/" "" nil nil nil nil "abc" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(607 "\"43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide\" =~ /]{0,})>]{0,})>([\\d]{0,}\\.)(.*)((
([\\w\\W\\s\\d][^<>]{0,})|[\\s]{0,}))<\\/a><\\/TD>]{0,})>([\\w\\W\\s\\d][^<>]{0,})<\\/TD>]{0,})>([\\w\\W\\s\\d][^<>]{0,})<\\/TD><\\/TR>/is" "]{0,})>]{0,})>([\\d]{0,}\\.)(.*)((
([\\w\\W\\s\\d][^<>]{0,})|[\\s]{0,}))<\\/a><\\/TD>]{0,})>([\\w\\W\\s\\d][^<>]{0,})<\\/TD>]{0,})>([\\w\\W\\s\\d][^<>]{0,})<\\/TD><\\/TR>" t nil t nil "43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide" nil "43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide" (" BGCOLOR='#DBE9E9'" " align=left valign=top" "43." "Word Processor
(N-1286)" "" "" nil " align=left valign=top" "Lega lstaff.com" " align=left valign=top" "CA - Statewide" nil nil nil nil nil)) -(608 "\"acb\" =~ /a[^a]b/" "a[^a]b" nil nil nil nil "acb" nil "acb" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(601 "\"the \\\"quick\\\" brown fox\" =~ /\"([^\\\\\"]+|\\\\.)*\"/" "\"([^\\\\\"]+|\\\\.)*\"" nil nil nil nil "the \"quick\" brown fox" nil "\"quick\"" ("quick")) +(602 "\"\\\"the \\\\\\\"quick\\\\\\\" brown fox\\\"\" =~ /\"([^\\\\\"]+|\\\\.)*\"/" "\"([^\\\\\"]+|\\\\.)*\"" nil nil nil nil "\"the \\\"quick\\\" brown fox\"" nil "\"the \\\"quick\\\" brown fox\"" (" brown fox")) +(603 "\"abc\" =~ /.*?/" ".*?" nil nil nil nil "abc" nil "" nil) +(604 "\"abc\" =~ /\\b/" "\\b" nil nil nil nil "abc" nil "" nil) +(605 "\"abc\" =~ /\\b/" "\\b" nil nil nil nil "abc" nil "" nil) +(606 "\"abc\" =~ /(?#)/" "" nil nil nil nil "abc" nil "" nil) +(607 "\"43.
Word Processor
(N-1286)
Lega lstaff.comCA - Statewide\" =~ /]{0,})>]{0,})>([\\d]{0,}\\.)(.*)((
([\\w\\W\\s\\d][^<>]{0,})|[\\s]{0,}))<\\/a><\\/TD>]{0,})>([\\w\\W\\s\\d][^<>]{0,})<\\/TD>]{0,})>([\\w\\W\\s\\d][^<>]{0,})<\\/TD><\\/TR>/is" "]{0,})>]{0,})>([\\d]{0,}\\.)(.*)((
([\\w\\W\\s\\d][^<>]{0,})|[\\s]{0,}))<\\/a><\\/TD>]{0,})>([\\w\\W\\s\\d][^<>]{0,})<\\/TD>]{0,})>([\\w\\W\\s\\d][^<>]{0,})<\\/TD><\\/TR>" t nil t nil "43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide" nil "43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide" (" BGCOLOR='#DBE9E9'" " align=left valign=top" "43." "Word Processor
(N-1286)" "" "" nil " align=left valign=top" "Lega lstaff.com" " align=left valign=top" "CA - Statewide")) +(608 "\"acb\" =~ /a[^a]b/" "a[^a]b" nil nil nil nil "acb" nil "acb" nil) (609 "\"a\\nb\" =~ /a[^a]b/" "a[^a]b" nil nil nil nil "a b" nil "a -b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(610 "\"acb\" =~ /a.b/" "a.b" nil nil nil nil "acb" nil "acb" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +b" nil) +(610 "\"acb\" =~ /a.b/" "a.b" nil nil nil nil "acb" nil "acb" nil) (611 "\"a\\nb\" =~ /a.b/" "a.b" nil nil nil nil "a b" nil nil nil) -(612 "\"acb\" =~ /a[^a]b/s" "a[^a]b" nil nil t nil "acb" nil "acb" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(612 "\"acb\" =~ /a[^a]b/s" "a[^a]b" nil nil t nil "acb" nil "acb" nil) (613 "\"a\\nb\" =~ /a[^a]b/s" "a[^a]b" nil nil t nil "a b" nil "a -b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(614 "\"acb\" =~ /a.b/s" "a.b" nil nil t nil "acb" nil "acb" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +b" nil) +(614 "\"acb\" =~ /a.b/s" "a.b" nil nil t nil "acb" nil "acb" nil) (615 "\"a\\nb\" =~ /a.b/s" "a.b" nil nil t nil "a b" nil "a -b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(616 "\"bac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bac" nil "bac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(617 "\"bbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbac" nil "bbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(618 "\"bbbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbac" nil "bbbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(619 "\"bbbbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbbac" nil "bbbbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(620 "\"bbbbbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbbbac" nil "bbbbbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(621 "\"bac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bac" nil "bac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(622 "\"bbac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bbac" nil "bbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(623 "\"bbbac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bbbac" nil "bbbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(624 "\"bbbbac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bbbbac" nil "bbbbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(625 "\"bbbbbac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bbbbbac" nil "bbbbbac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +b" nil) +(616 "\"bac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bac" nil "bac" ("a")) +(617 "\"bbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbac" nil "bbac" ("a")) +(618 "\"bbbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbac" nil "bbbac" ("a")) +(619 "\"bbbbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbbac" nil "bbbbac" ("a")) +(620 "\"bbbbbac\" =~ /^(b+?|a){1,2}?c/" "^(b+?|a){1,2}?c" nil nil nil nil "bbbbbac" nil "bbbbbac" ("a")) +(621 "\"bac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bac" nil "bac" ("a")) +(622 "\"bbac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bbac" nil "bbac" ("a")) +(623 "\"bbbac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bbbac" nil "bbbac" ("a")) +(624 "\"bbbbac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bbbbac" nil "bbbbac" ("a")) +(625 "\"bbbbbac\" =~ /^(b+|a){1,2}?c/" "^(b+|a){1,2}?c" nil nil nil nil "bbbbbac" nil "bbbbbac" ("a")) (626 "\"x\\nb\\n\" =~ /(?!\\A)x/m" "(?!\\A)x" nil t nil nil "x b " nil nil nil) -(627 "\"a\\bx\\n\" =~ /(?!\\A)x/m" "(?!\\A)x" nil t nil nil ("a" 8 "x" 10) nil "x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(628 "\"\\0{ab}\" =~ /\\x0{ab}/" "\\x0{ab}" nil nil nil nil ("" 0 "{ab}") nil ("" 0 "{ab}") (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(629 "\"CD\" =~ /(A|B)*?CD/" "(A|B)*?CD" nil nil nil nil "CD" nil "CD" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(630 "\"CD\" =~ /(A|B)*CD/" "(A|B)*CD" nil nil nil nil "CD" nil "CD" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(631 "\"ABABAB\" =~ /(AB)*?\\1/" "(AB)*?\\1" nil nil nil nil "ABABAB" nil "ABAB" ("AB" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(632 "\"ABABAB\" =~ /(AB)*\\1/" "(AB)*\\1" nil nil nil nil "ABABAB" nil "ABABAB" ("AB" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(627 "\"a\\bx\\n\" =~ /(?!\\A)x/m" "(?!\\A)x" nil t nil nil ("a" 8 "x" 10) nil "x" nil) +(628 "\"\\0{ab}\" =~ /\\x0{ab}/" "\\x0{ab}" nil nil nil nil ("" 0 "{ab}") nil ("" 0 "{ab}") nil) +(629 "\"CD\" =~ /(A|B)*?CD/" "(A|B)*?CD" nil nil nil nil "CD" nil "CD" nil) +(630 "\"CD\" =~ /(A|B)*CD/" "(A|B)*CD" nil nil nil nil "CD" nil "CD" nil) +(631 "\"ABABAB\" =~ /(AB)*?\\1/" "(AB)*?\\1" nil nil nil nil "ABABAB" nil "ABAB" ("AB")) +(632 "\"ABABAB\" =~ /(AB)*\\1/" "(AB)*\\1" nil nil nil nil "ABABAB" nil "ABABAB" ("AB")) (633 "\"doesn't matter\" =~ /(/" "(" nil nil nil nil "doesn't matter" t nil nil) (634 "\"doesn't matter\" =~ /(x)\\2/" "(x)\\2" nil nil nil nil "doesn't matter" t nil nil) -(635 "\"aaaaaaaaaac\" =~ /((a{0,5}){0,5}){0,5}[c]/" "((a{0,5}){0,5}){0,5}[c]" nil nil nil nil "aaaaaaaaaac" nil "aaaaaaaaaac" ("" "" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(635 "\"aaaaaaaaaac\" =~ /((a{0,5}){0,5}){0,5}[c]/" "((a{0,5}){0,5}){0,5}[c]" nil nil nil nil "aaaaaaaaaac" nil "aaaaaaaaaac" ("" "")) (636 "\"aaaaaaaaaa\" =~ /((a{0,5}){0,5}){0,5}[c]/" "((a{0,5}){0,5}){0,5}[c]" nil nil nil nil "aaaaaaaaaa" nil nil nil) -(637 "\"aaaaaaaaaac\" =~ /((a{0,5}){0,5})*[c]/" "((a{0,5}){0,5})*[c]" nil nil nil nil "aaaaaaaaaac" nil "aaaaaaaaaac" ("" "" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(637 "\"aaaaaaaaaac\" =~ /((a{0,5}){0,5})*[c]/" "((a{0,5}){0,5})*[c]" nil nil nil nil "aaaaaaaaaac" nil "aaaaaaaaaac" ("" "")) (638 "\"aaaaaaaaaa\" =~ /((a{0,5}){0,5})*[c]/" "((a{0,5}){0,5})*[c]" nil nil nil nil "aaaaaaaaaa" nil nil nil) -(639 "\"a\" =~ /(\\b)*a/" "(\\b)*a" nil nil nil nil "a" nil "a" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(640 "\"ab\" =~ /(a)*b/" "(a)*b" nil nil nil nil "ab" nil "ab" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(641 "\"ab\" =~ /(a|)*b/" "(a|)*b" nil nil nil nil "ab" nil "ab" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(642 "\"b\" =~ /(a|)*b/" "(a|)*b" nil nil nil nil "b" nil "b" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(639 "\"a\" =~ /(\\b)*a/" "(\\b)*a" nil nil nil nil "a" nil "a" ("")) +(640 "\"ab\" =~ /(a)*b/" "(a)*b" nil nil nil nil "ab" nil "ab" ("a")) +(641 "\"ab\" =~ /(a|)*b/" "(a|)*b" nil nil nil nil "ab" nil "ab" ("")) +(642 "\"b\" =~ /(a|)*b/" "(a|)*b" nil nil nil nil "b" nil "b" ("")) (643 "\"x\" =~ /(a|)*b/" "(a|)*b" nil nil nil nil "x" nil nil nil) -(644 "\"abab\" =~ /^(?:(a)|(b))*\\1\\2$/" "^(?:(a)|(b))*\\1\\2$" nil nil nil nil "abab" nil "abab" ("a" "b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(645 "\"abcxabcydef\" =~ /abc[^x]def/" "abc[^x]def" nil nil nil nil "abcxabcydef" nil "abcydef" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(646 "\"aax\" =~ /^(a|\\1x)*$/" "^(a|\\1x)*$" nil nil nil nil "aax" nil "aax" ("ax" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(647 "\"aaxa\" =~ /^(a|\\1x)*$/" "^(a|\\1x)*$" nil nil nil nil "aaxa" nil "aaxa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(648 "\"@{['']}\" =~ /(?#)/" "" nil nil nil nil "" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(649 "\"ab\" =~ /^(?:(a)|(b))*$/" "^(?:(a)|(b))*$" nil nil nil nil "ab" nil "ab" ("a" "b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(644 "\"abab\" =~ /^(?:(a)|(b))*\\1\\2$/" "^(?:(a)|(b))*\\1\\2$" nil nil nil nil "abab" nil "abab" ("a" "b")) +(645 "\"abcxabcydef\" =~ /abc[^x]def/" "abc[^x]def" nil nil nil nil "abcxabcydef" nil "abcydef" nil) +(646 "\"aax\" =~ /^(a|\\1x)*$/" "^(a|\\1x)*$" nil nil nil nil "aax" nil "aax" ("ax")) +(647 "\"aaxa\" =~ /^(a|\\1x)*$/" "^(a|\\1x)*$" nil nil nil nil "aaxa" nil "aaxa" ("a")) +(648 "\"@{['']}\" =~ /(?#)/" "" nil nil nil nil "" nil "" nil) +(649 "\"ab\" =~ /^(?:(a)|(b))*$/" "^(?:(a)|(b))*$" nil nil nil nil "ab" nil "ab" ("a" "b")) (650 "\"a\" =~ /[\\0]/" "[\\0]" nil nil nil nil "a" nil nil nil) -(651 "\"\\0\" =~ /[\\0]/" "[\\0]" nil nil nil nil ("" 0) nil ("" 0) (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(651 "\"\\0\" =~ /[\\0]/" "[\\0]" nil nil nil nil ("" 0) nil ("" 0) nil) (652 "\"a\" =~ /[\\1]/" "[\\1]" nil nil nil nil "a" nil nil nil) -(653 "\"\\1\" =~ /[\\1]/" "[\\1]" nil nil nil nil ("" 1) nil ("" 1) (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(653 "\"\\1\" =~ /[\\1]/" "[\\1]" nil nil nil nil ("" 1) nil ("" 1) nil) (654 "\"doesn't matter\" =~ /\\10()()()()()()()()()/" "\\10()()()()()()()()()" nil nil nil nil "doesn't matter" nil nil nil) (655 "\"a\" =~ /\\10()()()()()()()()()()/" "\\10()()()()()()()()()()" nil nil nil nil "a" nil nil nil) -(656 "\"ab\" =~ /a(?<)b/" "a(?<)b" nil nil nil nil "ab" nil "ab" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(656 "\"ab\" =~ /a(?<)b/" "a(?<)b" nil nil nil nil "ab" nil "ab" nil) (657 "\"doesn't matter\" =~ /[]/" "[]" nil nil nil nil "doesn't matter" t nil nil) (658 "\"doesn't matter\" =~ /[\\]/" "[\\]" nil nil nil nil "doesn't matter" t nil nil) -(659 "\"a\" =~ /()/" "()" nil nil nil nil "a" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(659 "\"a\" =~ /()/" "()" nil nil nil nil "a" nil "" ("")) (660 "\"x\" =~ /[\\x]/" "[\\x]" nil nil nil nil "x" nil nil nil) -(661 "\"\\0\" =~ /[\\x]/" "[\\x]" nil nil nil nil ("" 0) nil ("" 0) (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(662 "\"a\" =~ /((a)*)*/" "((a)*)*" nil nil nil nil "a" nil "a" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(663 "\"a\" =~ /()a\\1/" "()a\\1" nil nil nil nil "a" nil "a" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(661 "\"\\0\" =~ /[\\x]/" "[\\x]" nil nil nil nil ("" 0) nil ("" 0) nil) +(662 "\"a\" =~ /((a)*)*/" "((a)*)*" nil nil nil nil "a" nil "a" ("")) +(663 "\"a\" =~ /()a\\1/" "()a\\1" nil nil nil nil "a" nil "a" ("")) (664 "\"a\" =~ /a\\1()/" "a\\1()" nil nil nil nil "a" nil nil nil) -(665 "\"aaa\" =~ /a(?i)a(?-i)a/" "a(?i)a(?-i)a" nil nil nil nil "aaa" nil "aaa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(666 "\"aAa\" =~ /a(?i)a(?-i)a/" "a(?i)a(?-i)a" nil nil nil nil "aAa" nil "aAa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(665 "\"aaa\" =~ /a(?i)a(?-i)a/" "a(?i)a(?-i)a" nil nil nil nil "aaa" nil "aaa" nil) +(666 "\"aAa\" =~ /a(?i)a(?-i)a/" "a(?i)a(?-i)a" nil nil nil nil "aAa" nil "aAa" nil) (667 "\"aAA\" =~ /a(?i)a(?-i)a/" "a(?i)a(?-i)a" nil nil nil nil "aAA" nil nil nil) -(668 "\"aaaaa\" =~ /a(?i)a(?-i)a(?i)a(?-i)a/" "a(?i)a(?-i)a(?i)a(?-i)a" nil nil nil nil "aaaaa" nil "aaaaa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(669 "\"aAaAa\" =~ /a(?i)a(?-i)a(?i)a(?-i)a/" "a(?i)a(?-i)a(?i)a(?-i)a" nil nil nil nil "aAaAa" nil "aAaAa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(668 "\"aaaaa\" =~ /a(?i)a(?-i)a(?i)a(?-i)a/" "a(?i)a(?-i)a(?i)a(?-i)a" nil nil nil nil "aaaaa" nil "aaaaa" nil) +(669 "\"aAaAa\" =~ /a(?i)a(?-i)a(?i)a(?-i)a/" "a(?i)a(?-i)a(?i)a(?-i)a" nil nil nil nil "aAaAa" nil "aAaAa" nil) (670 "\"AaAaA\" =~ /a(?i)a(?-i)a(?i)a(?-i)a/" "a(?i)a(?-i)a(?i)a(?-i)a" nil nil nil nil "AaAaA" nil nil nil) (671 "\"aAAAa\" =~ /a(?i)a(?-i)a(?i)a(?-i)a/" "a(?i)a(?-i)a(?i)a(?-i)a" nil nil nil nil "aAAAa" nil nil nil) (672 "\"AaaaA\" =~ /a(?i)a(?-i)a(?i)a(?-i)a/" "a(?i)a(?-i)a(?i)a(?-i)a" nil nil nil nil "AaaaA" nil nil nil) @@ -13173,155 +13173,155 @@ b (675 "\"AAaaa\" =~ /a(?i)a(?-i)a(?i)a(?-i)a/" "a(?i)a(?-i)a(?i)a(?-i)a" nil nil nil nil "AAaaa" nil nil nil) (676 "\"a\" =~ /\\x/" "\\x" nil nil nil nil "a" nil nil nil) (677 "\"X\" =~ /\\x/" "\\x" nil nil nil nil "X" nil nil nil) -(678 "\"\\0\" =~ /\\x/" "\\x" nil nil nil nil ("" 0) nil ("" 0) (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(679 "\"a\" =~ /[a-c-e]/" "[a-c-e]" nil nil nil nil "a" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(680 "\"b\" =~ /[a-c-e]/" "[a-c-e]" nil nil nil nil "b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(678 "\"\\0\" =~ /\\x/" "\\x" nil nil nil nil ("" 0) nil ("" 0) nil) +(679 "\"a\" =~ /[a-c-e]/" "[a-c-e]" nil nil nil nil "a" nil "a" nil) +(680 "\"b\" =~ /[a-c-e]/" "[a-c-e]" nil nil nil nil "b" nil "b" nil) (681 "\"d\" =~ /[a-c-e]/" "[a-c-e]" nil nil nil nil "d" nil nil nil) -(682 "\"-\" =~ /[a-c-e]/" "[a-c-e]" nil nil nil nil "-" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(683 "\"b\" =~ /[b-\\d]/" "[b-\\d]" nil nil nil nil "b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(682 "\"-\" =~ /[a-c-e]/" "[a-c-e]" nil nil nil nil "-" nil "-" nil) +(683 "\"b\" =~ /[b-\\d]/" "[b-\\d]" nil nil nil nil "b" nil "b" nil) (684 "\"c\" =~ /[b-\\d]/" "[b-\\d]" nil nil nil nil "c" nil nil nil) (685 "\"d\" =~ /[b-\\d]/" "[b-\\d]" nil nil nil nil "d" nil nil nil) -(686 "\"-\" =~ /[b-\\d]/" "[b-\\d]" nil nil nil nil "-" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(687 "\"1\" =~ /[b-\\d]/" "[b-\\d]" nil nil nil nil "1" nil "1" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(686 "\"-\" =~ /[b-\\d]/" "[b-\\d]" nil nil nil nil "-" nil "-" nil) +(687 "\"1\" =~ /[b-\\d]/" "[b-\\d]" nil nil nil nil "1" nil "1" nil) (688 "\"d\" =~ /[\\d-f]/" "[\\d-f]" nil nil nil nil "d" nil nil nil) (689 "\"e\" =~ /[\\d-f]/" "[\\d-f]" nil nil nil nil "e" nil nil nil) -(690 "\"f\" =~ /[\\d-f]/" "[\\d-f]" nil nil nil nil "f" nil "f" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(691 "\"-\" =~ /[\\d-f]/" "[\\d-f]" nil nil nil nil "-" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(692 "\"1\" =~ /[\\d-f]/" "[\\d-f]" nil nil nil nil "1" nil "1" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(690 "\"f\" =~ /[\\d-f]/" "[\\d-f]" nil nil nil nil "f" nil "f" nil) +(691 "\"-\" =~ /[\\d-f]/" "[\\d-f]" nil nil nil nil "-" nil "-" nil) +(692 "\"1\" =~ /[\\d-f]/" "[\\d-f]" nil nil nil nil "1" nil "1" nil) (693 "\"doesn't matter\" =~ /[/" "[" nil nil nil nil "doesn't matter" t nil nil) -(694 "\"]\" =~ /]/" "]" nil nil nil nil "]" nil "]" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(694 "\"]\" =~ /]/" "]" nil nil nil nil "]" nil "]" nil) (695 "\"a\" =~ /]/" "]" nil nil nil nil "a" nil nil nil) (696 "\"doesn't matter\" =~ /[]/" "[]" nil nil nil nil "doesn't matter" t nil nil) -(697 "\"-\" =~ /[-a-c]/" "[-a-c]" nil nil nil nil "-" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(698 "\"a\" =~ /[-a-c]/" "[-a-c]" nil nil nil nil "a" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(699 "\"b\" =~ /[-a-c]/" "[-a-c]" nil nil nil nil "b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(697 "\"-\" =~ /[-a-c]/" "[-a-c]" nil nil nil nil "-" nil "-" nil) +(698 "\"a\" =~ /[-a-c]/" "[-a-c]" nil nil nil nil "a" nil "a" nil) +(699 "\"b\" =~ /[-a-c]/" "[-a-c]" nil nil nil nil "b" nil "b" nil) (700 "\"d\" =~ /[-a-c]/" "[-a-c]" nil nil nil nil "d" nil nil nil) -(701 "\"-\" =~ /[a-c-]/" "[a-c-]" nil nil nil nil "-" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(702 "\"a\" =~ /[a-c-]/" "[a-c-]" nil nil nil nil "a" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(703 "\"b\" =~ /[a-c-]/" "[a-c-]" nil nil nil nil "b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(701 "\"-\" =~ /[a-c-]/" "[a-c-]" nil nil nil nil "-" nil "-" nil) +(702 "\"a\" =~ /[a-c-]/" "[a-c-]" nil nil nil nil "a" nil "a" nil) +(703 "\"b\" =~ /[a-c-]/" "[a-c-]" nil nil nil nil "b" nil "b" nil) (704 "\"d\" =~ /[a-c-]/" "[a-c-]" nil nil nil nil "d" nil nil nil) (705 "\"a\" =~ /[-]/" "[-]" nil nil nil nil "a" nil nil nil) -(706 "\"-\" =~ /[-]/" "[-]" nil nil nil nil "-" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(706 "\"-\" =~ /[-]/" "[-]" nil nil nil nil "-" nil "-" nil) (707 "\"a\" =~ /[--]/" "[--]" nil nil nil nil "a" nil nil nil) -(708 "\"-\" =~ /[--]/" "[--]" nil nil nil nil "-" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(708 "\"-\" =~ /[--]/" "[--]" nil nil nil nil "-" nil "-" nil) (709 "\"a\" =~ /[---]/" "[---]" nil nil nil nil "a" nil nil nil) -(710 "\"-\" =~ /[---]/" "[---]" nil nil nil nil "-" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(711 "\"-\" =~ /[--b]/" "[--b]" nil nil nil nil "-" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(712 "\"a\" =~ /[--b]/" "[--b]" nil nil nil nil "a" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(710 "\"-\" =~ /[---]/" "[---]" nil nil nil nil "-" nil "-" nil) +(711 "\"-\" =~ /[--b]/" "[--b]" nil nil nil nil "-" nil "-" nil) +(712 "\"a\" =~ /[--b]/" "[--b]" nil nil nil nil "a" nil "a" nil) (713 "\"c\" =~ /[--b]/" "[--b]" nil nil nil nil "c" nil nil nil) (714 "\"doesn't matter\" =~ /[b--]/" "[b--]" nil nil nil nil "doesn't matter" t nil nil) -(715 "\"a{\" =~ /a{/" "a{" nil nil nil nil "a{" nil "a{" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(716 "\"a{}\" =~ /a{}/" "a{}" nil nil nil nil "a{}" nil "a{}" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(717 "\"a{3\" =~ /a{3/" "a{3" nil nil nil nil "a{3" nil "a{3" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(718 "\"a{3,\" =~ /a{3,/" "a{3," nil nil nil nil "a{3," nil "a{3," (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(715 "\"a{\" =~ /a{/" "a{" nil nil nil nil "a{" nil "a{" nil) +(716 "\"a{}\" =~ /a{}/" "a{}" nil nil nil nil "a{}" nil "a{}" nil) +(717 "\"a{3\" =~ /a{3/" "a{3" nil nil nil nil "a{3" nil "a{3" nil) +(718 "\"a{3,\" =~ /a{3,/" "a{3," nil nil nil nil "a{3," nil "a{3," nil) (719 "\"a{3,3}\" =~ /a{3, 3}/" "a{3, 3}" nil nil nil nil "a{3,3}" nil nil nil) -(720 "\"a{3, 3}\" =~ /a{3, 3}/" "a{3, 3}" nil nil nil nil "a{3, 3}" nil "a{3, 3}" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(720 "\"a{3, 3}\" =~ /a{3, 3}/" "a{3, 3}" nil nil nil nil "a{3, 3}" nil "a{3, 3}" nil) (721 "\"aaa\" =~ /a{3, 3}/" "a{3, 3}" nil nil nil nil "aaa" nil nil nil) -(722 "\"a{3,3}\" =~ /a{3, 3}/x" "a{3, 3}" nil nil nil t "a{3,3}" nil "a{3,3}" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(722 "\"a{3,3}\" =~ /a{3, 3}/x" "a{3, 3}" nil nil nil t "a{3,3}" nil "a{3,3}" nil) (723 "\"a{3, 3}\" =~ /a{3, 3}/x" "a{3, 3}" nil nil nil t "a{3, 3}" nil nil nil) (724 "\"aaa\" =~ /a{3, 3}/x" "a{3, 3}" nil nil nil t "aaa" nil nil nil) (725 "\"a{3,}\" =~ /a{3, }/" "a{3, }" nil nil nil nil "a{3,}" nil nil nil) -(726 "\"a{3, }\" =~ /a{3, }/" "a{3, }" nil nil nil nil "a{3, }" nil "a{3, }" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(726 "\"a{3, }\" =~ /a{3, }/" "a{3, }" nil nil nil nil "a{3, }" nil "a{3, }" nil) (727 "\"aaa\" =~ /a{3, }/" "a{3, }" nil nil nil nil "aaa" nil nil nil) -(728 "\"a{3,}\" =~ /a{3, }/x" "a{3, }" nil nil nil t "a{3,}" nil "a{3,}" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(728 "\"a{3,}\" =~ /a{3, }/x" "a{3, }" nil nil nil t "a{3,}" nil "a{3,}" nil) (729 "\"a{3, }\" =~ /a{3, }/x" "a{3, }" nil nil nil t "a{3, }" nil nil nil) (730 "\"aaa\" =~ /a{3, }/x" "a{3, }" nil nil nil t "aaa" nil nil nil) -(731 "\"\\0 x\" =~ /\\x x/" "\\x x" nil nil nil nil ("" 0 " x") nil ("" 0 " x") (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(731 "\"\\0 x\" =~ /\\x x/" "\\x x" nil nil nil nil ("" 0 " x") nil ("" 0 " x") nil) (732 "\"\\0x\" =~ /\\x x/" "\\x x" nil nil nil nil ("" 0 "x") nil nil nil) (733 "\"\\0 x\" =~ /\\x x/x" "\\x x" nil nil nil t ("" 0 " x") nil nil nil) -(734 "\"\\0x\" =~ /\\x x/x" "\\x x" nil nil nil t ("" 0 "x") nil ("" 0 "x") (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(734 "\"\\0x\" =~ /\\x x/x" "\\x x" nil nil nil t ("" 0 "x") nil ("" 0 "x") nil) (735 "\"\\0003\" =~ /\\x 3/" "\\x 3" nil nil nil nil ("" 0 "3") nil nil nil) -(736 "\"\\000 3\" =~ /\\x 3/" "\\x 3" nil nil nil nil ("" 0 " 3") nil ("" 0 " 3") (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(736 "\"\\000 3\" =~ /\\x 3/" "\\x 3" nil nil nil nil ("" 0 " 3") nil ("" 0 " 3") nil) (737 "\"x3\" =~ /\\x 3/" "\\x 3" nil nil nil nil "x3" nil nil nil) (738 "\"x 3\" =~ /\\x 3/" "\\x 3" nil nil nil nil "x 3" nil nil nil) -(739 "\"\\0003\" =~ /\\x 3/x" "\\x 3" nil nil nil t ("" 0 "3") nil ("" 0 "3") (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(739 "\"\\0003\" =~ /\\x 3/x" "\\x 3" nil nil nil t ("" 0 "3") nil ("" 0 "3") nil) (740 "\"\\000 3\" =~ /\\x 3/x" "\\x 3" nil nil nil t ("" 0 " 3") nil nil nil) (741 "\"x3\" =~ /\\x 3/x" "\\x 3" nil nil nil t "x3" nil nil nil) (742 "\"x 3\" =~ /\\x 3/x" "\\x 3" nil nil nil t "x 3" nil nil nil) (743 "\"a\" =~ /^a{ 1}$/" "^a{ 1}$" nil nil nil nil "a" nil nil nil) -(744 "\"a{ 1}\" =~ /^a{ 1}$/" "^a{ 1}$" nil nil nil nil "a{ 1}" nil "a{ 1}" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(744 "\"a{ 1}\" =~ /^a{ 1}$/" "^a{ 1}$" nil nil nil nil "a{ 1}" nil "a{ 1}" nil) (745 "\"a{1}\" =~ /^a{ 1}$/" "^a{ 1}$" nil nil nil nil "a{1}" nil nil nil) (746 "\"a\" =~ /^a{ 1}$/x" "^a{ 1}$" nil nil nil t "a" nil nil nil) (747 "\"a{ 1}\" =~ /^a{ 1}$/x" "^a{ 1}$" nil nil nil t "a{ 1}" nil nil nil) -(748 "\"a{1}\" =~ /^a{ 1}$/x" "^a{ 1}$" nil nil nil t "a{1}" nil "a{1}" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(749 "\"{}\" =~ /{}/" "{}" nil nil nil nil "{}" nil "{}" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(748 "\"a{1}\" =~ /^a{ 1}$/x" "^a{ 1}$" nil nil nil t "a{1}" nil "a{1}" nil) +(749 "\"{}\" =~ /{}/" "{}" nil nil nil nil "{}" nil "{}" nil) (750 "\"a\" =~ /{}/" "{}" nil nil nil nil "a" nil nil nil) (751 "\"doesn't matter\" =~ /{1}/" "{1}" nil nil nil nil "doesn't matter" t nil nil) (752 "\"doesn't matter\" =~ /*/" "*" nil nil nil nil "doesn't matter" t nil nil) -(753 "\"x\" =~ /|/" "|" nil nil nil nil "x" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(754 "\"\\0000\" =~ /\\0000/" "\\0000" nil nil nil nil ("" 0 "0") nil ("" 0 "0") (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(755 "\"ab\" =~ /a(?<)b/" "a(?<)b" nil nil nil nil "ab" nil "ab" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(756 "\"ab\" =~ /a(?i)b/" "a(?i)b" nil nil nil nil "ab" nil "ab" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(757 "\"aB\" =~ /a(?i)b/" "a(?i)b" nil nil nil nil "aB" nil "aB" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(753 "\"x\" =~ /|/" "|" nil nil nil nil "x" nil "" nil) +(754 "\"\\0000\" =~ /\\0000/" "\\0000" nil nil nil nil ("" 0 "0") nil ("" 0 "0") nil) +(755 "\"ab\" =~ /a(?<)b/" "a(?<)b" nil nil nil nil "ab" nil "ab" nil) +(756 "\"ab\" =~ /a(?i)b/" "a(?i)b" nil nil nil nil "ab" nil "ab" nil) +(757 "\"aB\" =~ /a(?i)b/" "a(?i)b" nil nil nil nil "aB" nil "aB" nil) (758 "\"Ab\" =~ /a(?i)b/" "a(?i)b" nil nil nil nil "Ab" nil nil nil) (759 "\"doesn't matter\" =~ /a(?i=a)/" "a(?i=a)" nil nil nil nil "doesn't matter" t nil nil) -(760 "\"aa\" =~ /a(?<=a){3000}a/" "a(?<=a){3000}a" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(760 "\"aa\" =~ /a(?<=a){3000}a/" "a(?<=a){3000}a" nil nil nil nil "aa" nil "aa" nil) (761 "\"xa\" =~ /a(?<=a){3000}a/" "a(?<=a){3000}a" nil nil nil nil "xa" nil nil nil) (762 "\"ax\" =~ /a(?<=a){3000}a/" "a(?<=a){3000}a" nil nil nil nil "ax" nil nil nil) -(763 "\"aa\" =~ /a(?!=a){3000}a/" "a(?!=a){3000}a" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(763 "\"aa\" =~ /a(?!=a){3000}a/" "a(?!=a){3000}a" nil nil nil nil "aa" nil "aa" nil) (764 "\"ax\" =~ /a(?!=a){3000}a/" "a(?!=a){3000}a" nil nil nil nil "ax" nil nil nil) (765 "\"xa\" =~ /a(?!=a){3000}a/" "a(?!=a){3000}a" nil nil nil nil "xa" nil nil nil) -(766 "\"aa\" =~ /a(){3000}a/" "a(){3000}a" nil nil nil nil "aa" nil "aa" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(766 "\"aa\" =~ /a(){3000}a/" "a(){3000}a" nil nil nil nil "aa" nil "aa" ("")) (767 "\"ax\" =~ /a(){3000}a/" "a(){3000}a" nil nil nil nil "ax" nil nil nil) (768 "\"xa\" =~ /a(){3000}a/" "a(){3000}a" nil nil nil nil "xa" nil nil nil) -(769 "\"aa\" =~ /a(?:){3000}a/" "a(?:){3000}a" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(769 "\"aa\" =~ /a(?:){3000}a/" "a(?:){3000}a" nil nil nil nil "aa" nil "aa" nil) (770 "\"ax\" =~ /a(?:){3000}a/" "a(?:){3000}a" nil nil nil nil "ax" nil nil nil) -(771 "\"aa\" =~ /a(?<=a)*a/" "a(?<=a)*a" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(771 "\"aa\" =~ /a(?<=a)*a/" "a(?<=a)*a" nil nil nil nil "aa" nil "aa" nil) (772 "\"ax\" =~ /a(?<=a)*a/" "a(?<=a)*a" nil nil nil nil "ax" nil nil nil) (773 "\"xa\" =~ /a(?<=a)*a/" "a(?<=a)*a" nil nil nil nil "xa" nil nil nil) -(774 "\"aa\" =~ /a(?!=a)*a/" "a(?!=a)*a" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(774 "\"aa\" =~ /a(?!=a)*a/" "a(?!=a)*a" nil nil nil nil "aa" nil "aa" nil) (775 "\"ax\" =~ /a(?!=a)*a/" "a(?!=a)*a" nil nil nil nil "ax" nil nil nil) (776 "\"xa\" =~ /a(?!=a)*a/" "a(?!=a)*a" nil nil nil nil "xa" nil nil nil) -(777 "\"aa\" =~ /a()*a/" "a()*a" nil nil nil nil "aa" nil "aa" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(777 "\"aa\" =~ /a()*a/" "a()*a" nil nil nil nil "aa" nil "aa" ("")) (778 "\"ax\" =~ /a()*a/" "a()*a" nil nil nil nil "ax" nil nil nil) (779 "\"xa\" =~ /a()*a/" "a()*a" nil nil nil nil "xa" nil nil nil) -(780 "\"aa\" =~ /a(?:)*a/" "a(?:)*a" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(780 "\"aa\" =~ /a(?:)*a/" "a(?:)*a" nil nil nil nil "aa" nil "aa" nil) (781 "\"ax\" =~ /a(?:)*a/" "a(?:)*a" nil nil nil nil "ax" nil nil nil) (782 "\"xa\" =~ /a(?:)*a/" "a(?:)*a" nil nil nil nil "xa" nil nil nil) (783 "\"aa\" =~ /x(?<=a)*a/" "x(?<=a)*a" nil nil nil nil "aa" nil nil nil) -(784 "\"xa\" =~ /x(?<=a)*a/" "x(?<=a)*a" nil nil nil nil "xa" nil "xa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(784 "\"xa\" =~ /x(?<=a)*a/" "x(?<=a)*a" nil nil nil nil "xa" nil "xa" nil) (785 "\"ax\" =~ /x(?<=a)*a/" "x(?<=a)*a" nil nil nil nil "ax" nil nil nil) -(786 "\"aa\" =~ /a(?<=(a))*\\1/" "a(?<=(a))*\\1" nil nil nil nil "aa" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(787 "\"aa\" =~ /a(?<=(a))*?\\1/" "a(?<=(a))*?\\1" nil nil nil nil "aa" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(788 "\"aa\" =~ /(?=(a)\\1)*aa/" "(?=(a)\\1)*aa" nil nil nil nil "aa" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(789 "\"aaaaabbbbb\" =~ /^((a|b){2,5}){2}$/" "^((a|b){2,5}){2}$" nil nil nil nil "aaaaabbbbb" nil "aaaaabbbbb" ("bbbbb" "b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(790 "\"babc\" =~ /^(b*|ba){1,2}bc/" "^(b*|ba){1,2}bc" nil nil nil nil "babc" nil "babc" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(791 "\"bbabc\" =~ /^(b*|ba){1,2}bc/" "^(b*|ba){1,2}bc" nil nil nil nil "bbabc" nil "bbabc" ("ba" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(792 "\"bababc\" =~ /^(b*|ba){1,2}bc/" "^(b*|ba){1,2}bc" nil nil nil nil "bababc" nil "bababc" ("ba" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(786 "\"aa\" =~ /a(?<=(a))*\\1/" "a(?<=(a))*\\1" nil nil nil nil "aa" nil "aa" ("a")) +(787 "\"aa\" =~ /a(?<=(a))*?\\1/" "a(?<=(a))*?\\1" nil nil nil nil "aa" nil "aa" ("a")) +(788 "\"aa\" =~ /(?=(a)\\1)*aa/" "(?=(a)\\1)*aa" nil nil nil nil "aa" nil "aa" ("a")) +(789 "\"aaaaabbbbb\" =~ /^((a|b){2,5}){2}$/" "^((a|b){2,5}){2}$" nil nil nil nil "aaaaabbbbb" nil "aaaaabbbbb" ("bbbbb" "b")) +(790 "\"babc\" =~ /^(b*|ba){1,2}bc/" "^(b*|ba){1,2}bc" nil nil nil nil "babc" nil "babc" ("")) +(791 "\"bbabc\" =~ /^(b*|ba){1,2}bc/" "^(b*|ba){1,2}bc" nil nil nil nil "bbabc" nil "bbabc" ("ba")) +(792 "\"bababc\" =~ /^(b*|ba){1,2}bc/" "^(b*|ba){1,2}bc" nil nil nil nil "bababc" nil "bababc" ("ba")) (793 "\"bababbc\" =~ /^(b*|ba){1,2}bc/" "^(b*|ba){1,2}bc" nil nil nil nil "bababbc" nil nil nil) (794 "\"babababc\" =~ /^(b*|ba){1,2}bc/" "^(b*|ba){1,2}bc" nil nil nil nil "babababc" nil nil nil) -(795 "\"aaaaac\" =~ /^a{4,5}(?:c|a)c$/" "^a{4,5}(?:c|a)c$" nil nil nil nil "aaaaac" nil "aaaaac" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(796 "\"aaaaaac\" =~ /^a{4,5}(?:c|a)c$/" "^a{4,5}(?:c|a)c$" nil nil nil nil "aaaaaac" nil "aaaaaac" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(797 "\"aaaaac\" =~ /^(a|){4,5}(?:c|a)c$/" "^(a|){4,5}(?:c|a)c$" nil nil nil nil "aaaaac" nil "aaaaac" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(798 "\"aaaaaac\" =~ /^(a|){4,5}(?:c|a)c$/" "^(a|){4,5}(?:c|a)c$" nil nil nil nil "aaaaaac" nil "aaaaaac" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(795 "\"aaaaac\" =~ /^a{4,5}(?:c|a)c$/" "^a{4,5}(?:c|a)c$" nil nil nil nil "aaaaac" nil "aaaaac" nil) +(796 "\"aaaaaac\" =~ /^a{4,5}(?:c|a)c$/" "^a{4,5}(?:c|a)c$" nil nil nil nil "aaaaaac" nil "aaaaaac" nil) +(797 "\"aaaaac\" =~ /^(a|){4,5}(?:c|a)c$/" "^(a|){4,5}(?:c|a)c$" nil nil nil nil "aaaaac" nil "aaaaac" ("")) +(798 "\"aaaaaac\" =~ /^(a|){4,5}(?:c|a)c$/" "^(a|){4,5}(?:c|a)c$" nil nil nil nil "aaaaaac" nil "aaaaaac" ("a")) (799 "\"eeexabc\" =~ /(?m:^).abc$/" "(?m:^).abc$" nil nil nil nil "eeexabc" nil nil nil) (800 "\"eee\\nxabc\" =~ /(?m:^).abc$/" "(?m:^).abc$" nil nil nil nil "eee -xabc" nil "xabc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(801 "\"abc\" =~ /(?m:^)abc/" "(?m:^)abc" nil nil nil nil "abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +xabc" nil "xabc" nil) +(801 "\"abc\" =~ /(?m:^)abc/" "(?m:^)abc" nil nil nil nil "abc" nil "abc" nil) (802 "\"\\nabc\" =~ /(?m:^)abc/" "(?m:^)abc" nil nil nil nil " -abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +abc" nil "abc" nil) (803 "\"abc\" =~ -/^abc/" "^abc" nil nil nil nil "abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +/^abc/" "^abc" nil nil nil nil "abc" nil "abc" nil) (804 "\"\\nabc\" =~ /^abc/" "^abc" nil nil nil nil " abc" nil nil nil) -(805 "\"abc\" =~ /\\Aabc/" "\\Aabc" nil nil nil nil "abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(805 "\"abc\" =~ /\\Aabc/" "\\Aabc" nil nil nil nil "abc" nil "abc" nil) (806 "\"\\nabc\" =~ /\\Aabc/" "\\Aabc" nil nil nil nil " abc" nil nil nil) -(807 "\"foo\" =~ /(?.*/)foo\"" "(?>.*/)foo" nil nil nil nil "/this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/" nil nil nil) -(826 "\"/this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo\" =~ \"(?>.*/)foo\"" "(?>.*/)foo" nil nil nil nil "/this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo" nil "/this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(827 "\"1.230003938\" =~ /(?>(\\.\\d\\d[1-9]?))\\d+/" "(?>(\\.\\d\\d[1-9]?))\\d+" nil nil nil nil "1.230003938" nil ".230003938" (".23" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(828 "\"1.875000282\" =~ /(?>(\\.\\d\\d[1-9]?))\\d+/" "(?>(\\.\\d\\d[1-9]?))\\d+" nil nil nil nil "1.875000282" nil ".875000282" (".875" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(826 "\"/this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo\" =~ \"(?>.*/)foo\"" "(?>.*/)foo" nil nil nil nil "/this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo" nil "/this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo" nil) +(827 "\"1.230003938\" =~ /(?>(\\.\\d\\d[1-9]?))\\d+/" "(?>(\\.\\d\\d[1-9]?))\\d+" nil nil nil nil "1.230003938" nil ".230003938" (".23")) +(828 "\"1.875000282\" =~ /(?>(\\.\\d\\d[1-9]?))\\d+/" "(?>(\\.\\d\\d[1-9]?))\\d+" nil nil nil nil "1.875000282" nil ".875000282" (".875")) (829 "\"1.235\" =~ /(?>(\\.\\d\\d[1-9]?))\\d+/" "(?>(\\.\\d\\d[1-9]?))\\d+" nil nil nil nil "1.235" nil nil nil) -(830 "\"now is the time for all good men to come to the aid of the party\" =~ /^((?>\\w+)|(?>\\s+))*$/" "^((?>\\w+)|(?>\\s+))*$" nil nil nil nil "now is the time for all good men to come to the aid of the party" nil "now is the time for all good men to come to the aid of the party" ("party" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(830 "\"now is the time for all good men to come to the aid of the party\" =~ /^((?>\\w+)|(?>\\s+))*$/" "^((?>\\w+)|(?>\\s+))*$" nil nil nil nil "now is the time for all good men to come to the aid of the party" nil "now is the time for all good men to come to the aid of the party" ("party")) (831 "\"this is not a line with only words and spaces!\" =~ /^((?>\\w+)|(?>\\s+))*$/" "^((?>\\w+)|(?>\\s+))*$" nil nil nil nil "this is not a line with only words and spaces!" nil nil nil) -(832 "\"12345a\" =~ /(\\d+)(\\w)/" "(\\d+)(\\w)" nil nil nil nil "12345a" nil "12345a" ("12345" "a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(833 "\"12345+\" =~ /(\\d+)(\\w)/" "(\\d+)(\\w)" nil nil nil nil "12345+" nil "12345" ("1234" "5" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(834 "\"12345a\" =~ /((?>\\d+))(\\w)/" "((?>\\d+))(\\w)" nil nil nil nil "12345a" nil "12345a" ("12345" "a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(832 "\"12345a\" =~ /(\\d+)(\\w)/" "(\\d+)(\\w)" nil nil nil nil "12345a" nil "12345a" ("12345" "a")) +(833 "\"12345+\" =~ /(\\d+)(\\w)/" "(\\d+)(\\w)" nil nil nil nil "12345+" nil "12345" ("1234" "5")) +(834 "\"12345a\" =~ /((?>\\d+))(\\w)/" "((?>\\d+))(\\w)" nil nil nil nil "12345a" nil "12345a" ("12345" "a")) (835 "\"12345+\" =~ /((?>\\d+))(\\w)/" "((?>\\d+))(\\w)" nil nil nil nil "12345+" nil nil nil) -(836 "\"aaab\" =~ /(?>a+)b/" "(?>a+)b" nil nil nil nil "aaab" nil "aaab" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(837 "\"aaab\" =~ /((?>a+)b)/" "((?>a+)b)" nil nil nil nil "aaab" nil "aaab" ("aaab" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(838 "\"aaab\" =~ /(?>(a+))b/" "(?>(a+))b" nil nil nil nil "aaab" nil "aaab" ("aaa" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(839 "\"aaabbbccc\" =~ /(?>b)+/" "(?>b)+" nil nil nil nil "aaabbbccc" nil "bbb" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(840 "\"aaabbbbccccd\" =~ /(?>a+|b+|c+)*c/" "(?>a+|b+|c+)*c" nil nil nil nil "aaabbbbccccd" nil "aaabbbbc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(841 "\"((abc(ade)ufh()()x\" =~ /((?>[^()]+)|\\([^()]*\\))+/" "((?>[^()]+)|\\([^()]*\\))+" nil nil nil nil "((abc(ade)ufh()()x" nil "abc(ade)ufh()()x" ("x" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(842 "\"(abc)\" =~ /\\(((?>[^()]+)|\\([^()]+\\))+\\)/" "\\(((?>[^()]+)|\\([^()]+\\))+\\)" nil nil nil nil "(abc)" nil "(abc)" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(843 "\"(abc(def)xyz)\" =~ /\\(((?>[^()]+)|\\([^()]+\\))+\\)/" "\\(((?>[^()]+)|\\([^()]+\\))+\\)" nil nil nil nil "(abc(def)xyz)" nil "(abc(def)xyz)" ("xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(836 "\"aaab\" =~ /(?>a+)b/" "(?>a+)b" nil nil nil nil "aaab" nil "aaab" nil) +(837 "\"aaab\" =~ /((?>a+)b)/" "((?>a+)b)" nil nil nil nil "aaab" nil "aaab" ("aaab")) +(838 "\"aaab\" =~ /(?>(a+))b/" "(?>(a+))b" nil nil nil nil "aaab" nil "aaab" ("aaa")) +(839 "\"aaabbbccc\" =~ /(?>b)+/" "(?>b)+" nil nil nil nil "aaabbbccc" nil "bbb" nil) +(840 "\"aaabbbbccccd\" =~ /(?>a+|b+|c+)*c/" "(?>a+|b+|c+)*c" nil nil nil nil "aaabbbbccccd" nil "aaabbbbc" nil) +(841 "\"((abc(ade)ufh()()x\" =~ /((?>[^()]+)|\\([^()]*\\))+/" "((?>[^()]+)|\\([^()]*\\))+" nil nil nil nil "((abc(ade)ufh()()x" nil "abc(ade)ufh()()x" ("x")) +(842 "\"(abc)\" =~ /\\(((?>[^()]+)|\\([^()]+\\))+\\)/" "\\(((?>[^()]+)|\\([^()]+\\))+\\)" nil nil nil nil "(abc)" nil "(abc)" ("abc")) +(843 "\"(abc(def)xyz)\" =~ /\\(((?>[^()]+)|\\([^()]+\\))+\\)/" "\\(((?>[^()]+)|\\([^()]+\\))+\\)" nil nil nil nil "(abc(def)xyz)" nil "(abc(def)xyz)" ("xyz")) (844 "\"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" =~ /\\(((?>[^()]+)|\\([^()]+\\))+\\)/" "\\(((?>[^()]+)|\\([^()]+\\))+\\)" nil nil nil nil "((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" nil nil nil) -(845 "\"ab\" =~ /a(?-i)b/i" "a(?-i)b" t nil nil nil "ab" nil "ab" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(846 "\"Ab\" =~ /a(?-i)b/i" "a(?-i)b" t nil nil nil "Ab" nil "Ab" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(845 "\"ab\" =~ /a(?-i)b/i" "a(?-i)b" t nil nil nil "ab" nil "ab" nil) +(846 "\"Ab\" =~ /a(?-i)b/i" "a(?-i)b" t nil nil nil "Ab" nil "Ab" nil) (847 "\"aB\" =~ /a(?-i)b/i" "a(?-i)b" t nil nil nil "aB" nil nil nil) (848 "\"AB\" =~ /a(?-i)b/i" "a(?-i)b" t nil nil nil "AB" nil nil nil) -(849 "\"a bcd e\" =~ /(a (?x)b c)d e/" "(a (?x)b c)d e" nil nil nil nil "a bcd e" nil "a bcd e" ("a bc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(849 "\"a bcd e\" =~ /(a (?x)b c)d e/" "(a (?x)b c)d e" nil nil nil nil "a bcd e" nil "a bcd e" ("a bc")) (850 "\"a b cd e\" =~ /(a (?x)b c)d e/" "(a (?x)b c)d e" nil nil nil nil "a b cd e" nil nil nil) (851 "\"abcd e\" =~ /(a (?x)b c)d e/" "(a (?x)b c)d e" nil nil nil nil "abcd e" nil nil nil) (852 "\"a bcde\" =~ /(a (?x)b c)d e/" "(a (?x)b c)d e" nil nil nil nil "a bcde" nil nil nil) -(853 "\"a bcde f\" =~ /(a b(?x)c d (?-x)e f)/" "(a b(?x)c d (?-x)e f)" nil nil nil nil "a bcde f" nil "a bcde f" ("a bcde f" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(853 "\"a bcde f\" =~ /(a b(?x)c d (?-x)e f)/" "(a b(?x)c d (?-x)e f)" nil nil nil nil "a bcde f" nil "a bcde f" ("a bcde f")) (854 "\"abcdef\" =~ /(a b(?x)c d (?-x)e f)/" "(a b(?x)c d (?-x)e f)" nil nil nil nil "abcdef" nil nil nil) -(855 "\"abc\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "abc" nil "abc" ("ab" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(856 "\"aBc\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "aBc" nil "aBc" ("aB" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(855 "\"abc\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "abc" nil "abc" ("ab")) +(856 "\"aBc\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "aBc" nil "aBc" ("aB")) (857 "\"abC\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "abC" nil nil nil) (858 "\"aBC\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "aBC" nil nil nil) (859 "\"Abc\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "Abc" nil nil nil) (860 "\"ABc\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "ABc" nil nil nil) (861 "\"ABC\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "ABC" nil nil nil) (862 "\"AbC\" =~ /(a(?i)b)c/" "(a(?i)b)c" nil nil nil nil "AbC" nil nil nil) -(863 "\"abc\" =~ /a(?i:b)c/" "a(?i:b)c" nil nil nil nil "abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(864 "\"aBc\" =~ /a(?i:b)c/" "a(?i:b)c" nil nil nil nil "aBc" nil "aBc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(863 "\"abc\" =~ /a(?i:b)c/" "a(?i:b)c" nil nil nil nil "abc" nil "abc" nil) +(864 "\"aBc\" =~ /a(?i:b)c/" "a(?i:b)c" nil nil nil nil "aBc" nil "aBc" nil) (865 "\"ABC\" =~ /a(?i:b)c/" "a(?i:b)c" nil nil nil nil "ABC" nil nil nil) (866 "\"abC\" =~ /a(?i:b)c/" "a(?i:b)c" nil nil nil nil "abC" nil nil nil) (867 "\"aBC\" =~ /a(?i:b)c/" "a(?i:b)c" nil nil nil nil "aBC" nil nil nil) -(868 "\"aBc\" =~ /a(?i:b)*c/" "a(?i:b)*c" nil nil nil nil "aBc" nil "aBc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(869 "\"aBBc\" =~ /a(?i:b)*c/" "a(?i:b)*c" nil nil nil nil "aBBc" nil "aBBc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(868 "\"aBc\" =~ /a(?i:b)*c/" "a(?i:b)*c" nil nil nil nil "aBc" nil "aBc" nil) +(869 "\"aBBc\" =~ /a(?i:b)*c/" "a(?i:b)*c" nil nil nil nil "aBBc" nil "aBBc" nil) (870 "\"aBC\" =~ /a(?i:b)*c/" "a(?i:b)*c" nil nil nil nil "aBC" nil nil nil) (871 "\"aBBC\" =~ /a(?i:b)*c/" "a(?i:b)*c" nil nil nil nil "aBBC" nil nil nil) -(872 "\"abcd\" =~ /a(?=b(?i)c)\\w\\wd/" "a(?=b(?i)c)\\w\\wd" nil nil nil nil "abcd" nil "abcd" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(873 "\"abCd\" =~ /a(?=b(?i)c)\\w\\wd/" "a(?=b(?i)c)\\w\\wd" nil nil nil nil "abCd" nil "abCd" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(872 "\"abcd\" =~ /a(?=b(?i)c)\\w\\wd/" "a(?=b(?i)c)\\w\\wd" nil nil nil nil "abcd" nil "abcd" nil) +(873 "\"abCd\" =~ /a(?=b(?i)c)\\w\\wd/" "a(?=b(?i)c)\\w\\wd" nil nil nil nil "abCd" nil "abCd" nil) (874 "\"aBCd\" =~ /a(?=b(?i)c)\\w\\wd/" "a(?=b(?i)c)\\w\\wd" nil nil nil nil "aBCd" nil nil nil) (875 "\"abcD\" =~ /a(?=b(?i)c)\\w\\wd/" "a(?=b(?i)c)\\w\\wd" nil nil nil nil "abcD" nil nil nil) -(876 "\"more than million\" =~ /(?s-i:more.*than).*million/i" "(?s-i:more.*than).*million" t nil nil nil "more than million" nil "more than million" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(877 "\"more than MILLION\" =~ /(?s-i:more.*than).*million/i" "(?s-i:more.*than).*million" t nil nil nil "more than MILLION" nil "more than MILLION" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(876 "\"more than million\" =~ /(?s-i:more.*than).*million/i" "(?s-i:more.*than).*million" t nil nil nil "more than million" nil "more than million" nil) +(877 "\"more than MILLION\" =~ /(?s-i:more.*than).*million/i" "(?s-i:more.*than).*million" t nil nil nil "more than MILLION" nil "more than MILLION" nil) (878 "\"more \\n than Million\" =~ /(?s-i:more.*than).*million/i" "(?s-i:more.*than).*million" t nil nil nil "more than Million" nil "more - than Million" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) + than Million" nil) (879 "\"MORE THAN MILLION\" =~ /(?s-i:more.*than).*million/i" "(?s-i:more.*than).*million" t nil nil nil "MORE THAN MILLION" nil nil nil) (880 "\"more \\n than \\n million\" =~ /(?s-i:more.*than).*million/i" "(?s-i:more.*than).*million" t nil nil nil "more than million" nil nil nil) -(881 "\"more than million\" =~ /(?:(?s-i)more.*than).*million/i" "(?:(?s-i)more.*than).*million" t nil nil nil "more than million" nil "more than million" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(882 "\"more than MILLION\" =~ /(?:(?s-i)more.*than).*million/i" "(?:(?s-i)more.*than).*million" t nil nil nil "more than MILLION" nil "more than MILLION" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(881 "\"more than million\" =~ /(?:(?s-i)more.*than).*million/i" "(?:(?s-i)more.*than).*million" t nil nil nil "more than million" nil "more than million" nil) +(882 "\"more than MILLION\" =~ /(?:(?s-i)more.*than).*million/i" "(?:(?s-i)more.*than).*million" t nil nil nil "more than MILLION" nil "more than MILLION" nil) (883 "\"more \\n than Million\" =~ /(?:(?s-i)more.*than).*million/i" "(?:(?s-i)more.*than).*million" t nil nil nil "more than Million" nil "more - than Million" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) + than Million" nil) (884 "\"MORE THAN MILLION\" =~ /(?:(?s-i)more.*than).*million/i" "(?:(?s-i)more.*than).*million" t nil nil nil "MORE THAN MILLION" nil nil nil) (885 "\"more \\n than \\n million\" =~ /(?:(?s-i)more.*than).*million/i" "(?:(?s-i)more.*than).*million" t nil nil nil "more than million" nil nil nil) -(886 "\"abc\" =~ /(?>a(?i)b+)+c/" "(?>a(?i)b+)+c" nil nil nil nil "abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(887 "\"aBbc\" =~ /(?>a(?i)b+)+c/" "(?>a(?i)b+)+c" nil nil nil nil "aBbc" nil "aBbc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(888 "\"aBBc\" =~ /(?>a(?i)b+)+c/" "(?>a(?i)b+)+c" nil nil nil nil "aBBc" nil "aBBc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(886 "\"abc\" =~ /(?>a(?i)b+)+c/" "(?>a(?i)b+)+c" nil nil nil nil "abc" nil "abc" nil) +(887 "\"aBbc\" =~ /(?>a(?i)b+)+c/" "(?>a(?i)b+)+c" nil nil nil nil "aBbc" nil "aBbc" nil) +(888 "\"aBBc\" =~ /(?>a(?i)b+)+c/" "(?>a(?i)b+)+c" nil nil nil nil "aBBc" nil "aBBc" nil) (889 "\"Abc\" =~ /(?>a(?i)b+)+c/" "(?>a(?i)b+)+c" nil nil nil nil "Abc" nil nil nil) (890 "\"abAb\" =~ /(?>a(?i)b+)+c/" "(?>a(?i)b+)+c" nil nil nil nil "abAb" nil nil nil) (891 "\"abbC\" =~ /(?>a(?i)b+)+c/" "(?>a(?i)b+)+c" nil nil nil nil "abbC" nil nil nil) -(892 "\"abc\" =~ /(?=a(?i)b)\\w\\wc/" "(?=a(?i)b)\\w\\wc" nil nil nil nil "abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(893 "\"aBc\" =~ /(?=a(?i)b)\\w\\wc/" "(?=a(?i)b)\\w\\wc" nil nil nil nil "aBc" nil "aBc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(892 "\"abc\" =~ /(?=a(?i)b)\\w\\wc/" "(?=a(?i)b)\\w\\wc" nil nil nil nil "abc" nil "abc" nil) +(893 "\"aBc\" =~ /(?=a(?i)b)\\w\\wc/" "(?=a(?i)b)\\w\\wc" nil nil nil nil "aBc" nil "aBc" nil) (894 "\"Ab\" =~ /(?=a(?i)b)\\w\\wc/" "(?=a(?i)b)\\w\\wc" nil nil nil nil "Ab" nil nil nil) (895 "\"abC\" =~ /(?=a(?i)b)\\w\\wc/" "(?=a(?i)b)\\w\\wc" nil nil nil nil "abC" nil nil nil) (896 "\"aBC\" =~ /(?=a(?i)b)\\w\\wc/" "(?=a(?i)b)\\w\\wc" nil nil nil nil "aBC" nil nil nil) -(897 "\"abxxc\" =~ /(?<=a(?i)b)(\\w\\w)c/" "(?<=a(?i)b)(\\w\\w)c" nil nil nil nil "abxxc" nil "xxc" ("xx" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(898 "\"aBxxc\" =~ /(?<=a(?i)b)(\\w\\w)c/" "(?<=a(?i)b)(\\w\\w)c" nil nil nil nil "aBxxc" nil "xxc" ("xx" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(897 "\"abxxc\" =~ /(?<=a(?i)b)(\\w\\w)c/" "(?<=a(?i)b)(\\w\\w)c" nil nil nil nil "abxxc" nil "xxc" ("xx")) +(898 "\"aBxxc\" =~ /(?<=a(?i)b)(\\w\\w)c/" "(?<=a(?i)b)(\\w\\w)c" nil nil nil nil "aBxxc" nil "xxc" ("xx")) (899 "\"Abxxc\" =~ /(?<=a(?i)b)(\\w\\w)c/" "(?<=a(?i)b)(\\w\\w)c" nil nil nil nil "Abxxc" nil nil nil) (900 "\"ABxxc\" =~ /(?<=a(?i)b)(\\w\\w)c/" "(?<=a(?i)b)(\\w\\w)c" nil nil nil nil "ABxxc" nil nil nil) (901 "\"abxxC\" =~ /(?<=a(?i)b)(\\w\\w)c/" "(?<=a(?i)b)(\\w\\w)c" nil nil nil nil "abxxC" nil nil nil) -(902 "\"aA\" =~ /(?:(a)|b)(?(1)A|B)/" "(?:(a)|b)(?(1)A|B)" nil nil nil nil "aA" nil "aA" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(903 "\"bB\" =~ /(?:(a)|b)(?(1)A|B)/" "(?:(a)|b)(?(1)A|B)" nil nil nil nil "bB" nil "bB" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(902 "\"aA\" =~ /(?:(a)|b)(?(1)A|B)/" "(?:(a)|b)(?(1)A|B)" nil nil nil nil "aA" nil "aA" ("a")) +(903 "\"bB\" =~ /(?:(a)|b)(?(1)A|B)/" "(?:(a)|b)(?(1)A|B)" nil nil nil nil "bB" nil "bB" nil) (904 "\"aB\" =~ /(?:(a)|b)(?(1)A|B)/" "(?:(a)|b)(?(1)A|B)" nil nil nil nil "aB" nil nil nil) (905 "\"bA\" =~ /(?:(a)|b)(?(1)A|B)/" "(?:(a)|b)(?(1)A|B)" nil nil nil nil "bA" nil nil nil) -(906 "\"aa\" =~ /^(a)?(?(1)a|b)+$/" "^(a)?(?(1)a|b)+$" nil nil nil nil "aa" nil "aa" ("a" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(907 "\"b\" =~ /^(a)?(?(1)a|b)+$/" "^(a)?(?(1)a|b)+$" nil nil nil nil "b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(908 "\"bb\" =~ /^(a)?(?(1)a|b)+$/" "^(a)?(?(1)a|b)+$" nil nil nil nil "bb" nil "bb" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(906 "\"aa\" =~ /^(a)?(?(1)a|b)+$/" "^(a)?(?(1)a|b)+$" nil nil nil nil "aa" nil "aa" ("a")) +(907 "\"b\" =~ /^(a)?(?(1)a|b)+$/" "^(a)?(?(1)a|b)+$" nil nil nil nil "b" nil "b" nil) +(908 "\"bb\" =~ /^(a)?(?(1)a|b)+$/" "^(a)?(?(1)a|b)+$" nil nil nil nil "bb" nil "bb" nil) (909 "\"ab\" =~ /^(a)?(?(1)a|b)+$/" "^(a)?(?(1)a|b)+$" nil nil nil nil "ab" nil nil nil) -(910 "\"abc:\" =~ /^(?(?=abc)\\w{3}:|\\d\\d)$/" "^(?(?=abc)\\w{3}:|\\d\\d)$" nil nil nil nil "abc:" nil "abc:" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(911 "\"12\" =~ /^(?(?=abc)\\w{3}:|\\d\\d)$/" "^(?(?=abc)\\w{3}:|\\d\\d)$" nil nil nil nil "12" nil "12" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(910 "\"abc:\" =~ /^(?(?=abc)\\w{3}:|\\d\\d)$/" "^(?(?=abc)\\w{3}:|\\d\\d)$" nil nil nil nil "abc:" nil "abc:" nil) +(911 "\"12\" =~ /^(?(?=abc)\\w{3}:|\\d\\d)$/" "^(?(?=abc)\\w{3}:|\\d\\d)$" nil nil nil nil "12" nil "12" nil) (912 "\"123\" =~ /^(?(?=abc)\\w{3}:|\\d\\d)$/" "^(?(?=abc)\\w{3}:|\\d\\d)$" nil nil nil nil "123" nil nil nil) (913 "\"xyz\" =~ /^(?(?=abc)\\w{3}:|\\d\\d)$/" "^(?(?=abc)\\w{3}:|\\d\\d)$" nil nil nil nil "xyz" nil nil nil) -(914 "\"abc:\" =~ /^(?(?!abc)\\d\\d|\\w{3}:)$/" "^(?(?!abc)\\d\\d|\\w{3}:)$" nil nil nil nil "abc:" nil "abc:" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(915 "\"12\" =~ /^(?(?!abc)\\d\\d|\\w{3}:)$/" "^(?(?!abc)\\d\\d|\\w{3}:)$" nil nil nil nil "12" nil "12" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(914 "\"abc:\" =~ /^(?(?!abc)\\d\\d|\\w{3}:)$/" "^(?(?!abc)\\d\\d|\\w{3}:)$" nil nil nil nil "abc:" nil "abc:" nil) +(915 "\"12\" =~ /^(?(?!abc)\\d\\d|\\w{3}:)$/" "^(?(?!abc)\\d\\d|\\w{3}:)$" nil nil nil nil "12" nil "12" nil) (916 "\"123\" =~ /^(?(?!abc)\\d\\d|\\w{3}:)$/" "^(?(?!abc)\\d\\d|\\w{3}:)$" nil nil nil nil "123" nil nil nil) (917 "\"xyz\" =~ /^(?(?!abc)\\d\\d|\\w{3}:)$/" "^(?(?!abc)\\d\\d|\\w{3}:)$" nil nil nil nil "xyz" nil nil nil) -(918 "\"foobar\" =~ /(?(?<=foo)bar|cat)/" "(?(?<=foo)bar|cat)" nil nil nil nil "foobar" nil "bar" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(919 "\"cat\" =~ /(?(?<=foo)bar|cat)/" "(?(?<=foo)bar|cat)" nil nil nil nil "cat" nil "cat" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(920 "\"fcat\" =~ /(?(?<=foo)bar|cat)/" "(?(?<=foo)bar|cat)" nil nil nil nil "fcat" nil "cat" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(921 "\"focat\" =~ /(?(?<=foo)bar|cat)/" "(?(?<=foo)bar|cat)" nil nil nil nil "focat" nil "cat" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(918 "\"foobar\" =~ /(?(?<=foo)bar|cat)/" "(?(?<=foo)bar|cat)" nil nil nil nil "foobar" nil "bar" nil) +(919 "\"cat\" =~ /(?(?<=foo)bar|cat)/" "(?(?<=foo)bar|cat)" nil nil nil nil "cat" nil "cat" nil) +(920 "\"fcat\" =~ /(?(?<=foo)bar|cat)/" "(?(?<=foo)bar|cat)" nil nil nil nil "fcat" nil "cat" nil) +(921 "\"focat\" =~ /(?(?<=foo)bar|cat)/" "(?(?<=foo)bar|cat)" nil nil nil nil "focat" nil "cat" nil) (922 "\"foocat\" =~ /(?(?<=foo)bar|cat)/" "(?(?<=foo)bar|cat)" nil nil nil nil "foocat" nil nil nil) -(923 "\"foobar\" =~ /(?(?a*)*/" "(?>a*)*" nil nil nil nil "a" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(955 "\"aa\" =~ /(?>a*)*/" "(?>a*)*" nil nil nil nil "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(956 "\"aaaa\" =~ /(?>a*)*/" "(?>a*)*" nil nil nil nil "aaaa" nil "aaaa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(957 "\"abc\" =~ /(abc|)+/" "(abc|)+" nil nil nil nil "abc" nil "abc" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(958 "\"abcabc\" =~ /(abc|)+/" "(abc|)+" nil nil nil nil "abcabc" nil "abcabc" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(959 "\"abcabcabc\" =~ /(abc|)+/" "(abc|)+" nil nil nil nil "abcabcabc" nil "abcabcabc" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(960 "\"xyz\" =~ /(abc|)+/" "(abc|)+" nil nil nil nil "xyz" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(961 "\"a\" =~ /([a]*)*/" "([a]*)*" nil nil nil nil "a" nil "a" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(962 "\"aaaaa\" =~ /([a]*)*/" "([a]*)*" nil nil nil nil "aaaaa" nil "aaaaa" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(963 "\"a\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "a" nil "a" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(964 "\"b\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "b" nil "b" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(965 "\"ababab\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "ababab" nil "ababab" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(966 "\"aaaabcde\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "aaaabcde" nil "aaaab" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(967 "\"bbbb\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "bbbb" nil "bbbb" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(968 "\"b\" =~ /([^a]*)*/" "([^a]*)*" nil nil nil nil "b" nil "b" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(969 "\"bbbb\" =~ /([^a]*)*/" "([^a]*)*" nil nil nil nil "bbbb" nil "bbbb" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(970 "\"aaa\" =~ /([^a]*)*/" "([^a]*)*" nil nil nil nil "aaa" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(971 "\"cccc\" =~ /([^ab]*)*/" "([^ab]*)*" nil nil nil nil "cccc" nil "cccc" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(972 "\"abab\" =~ /([^ab]*)*/" "([^ab]*)*" nil nil nil nil "abab" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(973 "\"a\" =~ /([a]*?)*/" "([a]*?)*" nil nil nil nil "a" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(974 "\"aaaa\" =~ /([a]*?)*/" "([a]*?)*" nil nil nil nil "aaaa" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(975 "\"a\" =~ /([ab]*?)*/" "([ab]*?)*" nil nil nil nil "a" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(976 "\"b\" =~ /([ab]*?)*/" "([ab]*?)*" nil nil nil nil "b" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(977 "\"abab\" =~ /([ab]*?)*/" "([ab]*?)*" nil nil nil nil "abab" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(978 "\"baba\" =~ /([ab]*?)*/" "([ab]*?)*" nil nil nil nil "baba" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(979 "\"b\" =~ /([^a]*?)*/" "([^a]*?)*" nil nil nil nil "b" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(980 "\"bbbb\" =~ /([^a]*?)*/" "([^a]*?)*" nil nil nil nil "bbbb" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(981 "\"aaa\" =~ /([^a]*?)*/" "([^a]*?)*" nil nil nil nil "aaa" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(982 "\"c\" =~ /([^ab]*?)*/" "([^ab]*?)*" nil nil nil nil "c" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(983 "\"cccc\" =~ /([^ab]*?)*/" "([^ab]*?)*" nil nil nil nil "cccc" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(984 "\"baba\" =~ /([^ab]*?)*/" "([^ab]*?)*" nil nil nil nil "baba" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(985 "\"a\" =~ /(?>a*)*/" "(?>a*)*" nil nil nil nil "a" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(986 "\"aaabcde\" =~ /(?>a*)*/" "(?>a*)*" nil nil nil nil "aaabcde" nil "aaa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(987 "\"aaaaa\" =~ /((?>a*))*/" "((?>a*))*" nil nil nil nil "aaaaa" nil "aaaaa" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(988 "\"aabbaa\" =~ /((?>a*))*/" "((?>a*))*" nil nil nil nil "aabbaa" nil "aa" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(989 "\"aaaaa\" =~ /((?>a*?))*/" "((?>a*?))*" nil nil nil nil "aaaaa" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(990 "\"aabbaa\" =~ /((?>a*?))*/" "((?>a*?))*" nil nil nil nil "aabbaa" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(991 "\"12-sep-98\" =~ /(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) /x" "(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) " nil nil nil t "12-sep-98" nil "12-sep-98" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(992 "\"12-09-98\" =~ /(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) /x" "(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) " nil nil nil t "12-09-98" nil "12-09-98" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(947 "\"blah blah\" =~ /((?i)blah)\\s+(?i:\\1)/" "((?i)blah)\\s+(?i:\\1)" nil nil nil nil "blah blah" nil "blah blah" ("blah")) +(948 "\"BLAH BLAH\" =~ /((?i)blah)\\s+(?i:\\1)/" "((?i)blah)\\s+(?i:\\1)" nil nil nil nil "BLAH BLAH" nil "BLAH BLAH" ("BLAH")) +(949 "\"Blah Blah\" =~ /((?i)blah)\\s+(?i:\\1)/" "((?i)blah)\\s+(?i:\\1)" nil nil nil nil "Blah Blah" nil "Blah Blah" ("Blah")) +(950 "\"blaH blaH\" =~ /((?i)blah)\\s+(?i:\\1)/" "((?i)blah)\\s+(?i:\\1)" nil nil nil nil "blaH blaH" nil "blaH blaH" ("blaH")) +(951 "\"blah BLAH\" =~ /((?i)blah)\\s+(?i:\\1)/" "((?i)blah)\\s+(?i:\\1)" nil nil nil nil "blah BLAH" nil "blah BLAH" ("blah")) +(952 "\"Blah blah\" =~ /((?i)blah)\\s+(?i:\\1)/" "((?i)blah)\\s+(?i:\\1)" nil nil nil nil "Blah blah" nil "Blah blah" ("Blah")) +(953 "\"blaH blah\" =~ /((?i)blah)\\s+(?i:\\1)/" "((?i)blah)\\s+(?i:\\1)" nil nil nil nil "blaH blah" nil "blaH blah" ("blaH")) +(954 "\"a\" =~ /(?>a*)*/" "(?>a*)*" nil nil nil nil "a" nil "a" nil) +(955 "\"aa\" =~ /(?>a*)*/" "(?>a*)*" nil nil nil nil "aa" nil "aa" nil) +(956 "\"aaaa\" =~ /(?>a*)*/" "(?>a*)*" nil nil nil nil "aaaa" nil "aaaa" nil) +(957 "\"abc\" =~ /(abc|)+/" "(abc|)+" nil nil nil nil "abc" nil "abc" ("")) +(958 "\"abcabc\" =~ /(abc|)+/" "(abc|)+" nil nil nil nil "abcabc" nil "abcabc" ("")) +(959 "\"abcabcabc\" =~ /(abc|)+/" "(abc|)+" nil nil nil nil "abcabcabc" nil "abcabcabc" ("")) +(960 "\"xyz\" =~ /(abc|)+/" "(abc|)+" nil nil nil nil "xyz" nil "" ("")) +(961 "\"a\" =~ /([a]*)*/" "([a]*)*" nil nil nil nil "a" nil "a" ("")) +(962 "\"aaaaa\" =~ /([a]*)*/" "([a]*)*" nil nil nil nil "aaaaa" nil "aaaaa" ("")) +(963 "\"a\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "a" nil "a" ("")) +(964 "\"b\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "b" nil "b" ("")) +(965 "\"ababab\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "ababab" nil "ababab" ("")) +(966 "\"aaaabcde\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "aaaabcde" nil "aaaab" ("")) +(967 "\"bbbb\" =~ /([ab]*)*/" "([ab]*)*" nil nil nil nil "bbbb" nil "bbbb" ("")) +(968 "\"b\" =~ /([^a]*)*/" "([^a]*)*" nil nil nil nil "b" nil "b" ("")) +(969 "\"bbbb\" =~ /([^a]*)*/" "([^a]*)*" nil nil nil nil "bbbb" nil "bbbb" ("")) +(970 "\"aaa\" =~ /([^a]*)*/" "([^a]*)*" nil nil nil nil "aaa" nil "" ("")) +(971 "\"cccc\" =~ /([^ab]*)*/" "([^ab]*)*" nil nil nil nil "cccc" nil "cccc" ("")) +(972 "\"abab\" =~ /([^ab]*)*/" "([^ab]*)*" nil nil nil nil "abab" nil "" ("")) +(973 "\"a\" =~ /([a]*?)*/" "([a]*?)*" nil nil nil nil "a" nil "" ("")) +(974 "\"aaaa\" =~ /([a]*?)*/" "([a]*?)*" nil nil nil nil "aaaa" nil "" ("")) +(975 "\"a\" =~ /([ab]*?)*/" "([ab]*?)*" nil nil nil nil "a" nil "" ("")) +(976 "\"b\" =~ /([ab]*?)*/" "([ab]*?)*" nil nil nil nil "b" nil "" ("")) +(977 "\"abab\" =~ /([ab]*?)*/" "([ab]*?)*" nil nil nil nil "abab" nil "" ("")) +(978 "\"baba\" =~ /([ab]*?)*/" "([ab]*?)*" nil nil nil nil "baba" nil "" ("")) +(979 "\"b\" =~ /([^a]*?)*/" "([^a]*?)*" nil nil nil nil "b" nil "" ("")) +(980 "\"bbbb\" =~ /([^a]*?)*/" "([^a]*?)*" nil nil nil nil "bbbb" nil "" ("")) +(981 "\"aaa\" =~ /([^a]*?)*/" "([^a]*?)*" nil nil nil nil "aaa" nil "" ("")) +(982 "\"c\" =~ /([^ab]*?)*/" "([^ab]*?)*" nil nil nil nil "c" nil "" ("")) +(983 "\"cccc\" =~ /([^ab]*?)*/" "([^ab]*?)*" nil nil nil nil "cccc" nil "" ("")) +(984 "\"baba\" =~ /([^ab]*?)*/" "([^ab]*?)*" nil nil nil nil "baba" nil "" ("")) +(985 "\"a\" =~ /(?>a*)*/" "(?>a*)*" nil nil nil nil "a" nil "a" nil) +(986 "\"aaabcde\" =~ /(?>a*)*/" "(?>a*)*" nil nil nil nil "aaabcde" nil "aaa" nil) +(987 "\"aaaaa\" =~ /((?>a*))*/" "((?>a*))*" nil nil nil nil "aaaaa" nil "aaaaa" ("")) +(988 "\"aabbaa\" =~ /((?>a*))*/" "((?>a*))*" nil nil nil nil "aabbaa" nil "aa" ("")) +(989 "\"aaaaa\" =~ /((?>a*?))*/" "((?>a*?))*" nil nil nil nil "aaaaa" nil "" ("")) +(990 "\"aabbaa\" =~ /((?>a*?))*/" "((?>a*?))*" nil nil nil nil "aabbaa" nil "" ("")) +(991 "\"12-sep-98\" =~ /(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) /x" "(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) " nil nil nil t "12-sep-98" nil "12-sep-98" nil) +(992 "\"12-09-98\" =~ /(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) /x" "(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) " nil nil nil t "12-09-98" nil "12-09-98" nil) (993 "\"sep-12-98\" =~ /(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) /x" "(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) " nil nil nil t "sep-12-98" nil nil nil) -(994 "\"foobarfoo\" =~ /(?<=(foo))bar\\1/" "(?<=(foo))bar\\1" nil nil nil nil "foobarfoo" nil "barfoo" ("foo" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(995 "\"foobarfootling\" =~ /(?<=(foo))bar\\1/" "(?<=(foo))bar\\1" nil nil nil nil "foobarfootling" nil "barfoo" ("foo" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(994 "\"foobarfoo\" =~ /(?<=(foo))bar\\1/" "(?<=(foo))bar\\1" nil nil nil nil "foobarfoo" nil "barfoo" ("foo")) +(995 "\"foobarfootling\" =~ /(?<=(foo))bar\\1/" "(?<=(foo))bar\\1" nil nil nil nil "foobarfootling" nil "barfoo" ("foo")) (996 "\"foobar\" =~ /(?<=(foo))bar\\1/" "(?<=(foo))bar\\1" nil nil nil nil "foobar" nil nil nil) (997 "\"barfoo\" =~ /(?<=(foo))bar\\1/" "(?<=(foo))bar\\1" nil nil nil nil "barfoo" nil nil nil) -(998 "\"saturday\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "saturday" nil "saturday" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(999 "\"sunday\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "sunday" nil "sunday" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1000 "\"Saturday\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "Saturday" nil "Saturday" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1001 "\"Sunday\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "Sunday" nil "Sunday" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1002 "\"SATURDAY\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "SATURDAY" nil "SATURDAY" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1003 "\"SUNDAY\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "SUNDAY" nil "SUNDAY" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1004 "\"SunDay\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "SunDay" nil "SunDay" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1005 "\"abcx\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "abcx" nil "abcx" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1006 "\"aBCx\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "aBCx" nil "aBCx" ("aBC" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1007 "\"bbx\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "bbx" nil "bbx" ("bb" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1008 "\"BBx\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "BBx" nil "BBx" ("BB" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(998 "\"saturday\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "saturday" nil "saturday" nil) +(999 "\"sunday\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "sunday" nil "sunday" nil) +(1000 "\"Saturday\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "Saturday" nil "Saturday" nil) +(1001 "\"Sunday\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "Sunday" nil "Sunday" nil) +(1002 "\"SATURDAY\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "SATURDAY" nil "SATURDAY" nil) +(1003 "\"SUNDAY\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "SUNDAY" nil "SUNDAY" nil) +(1004 "\"SunDay\" =~ /(?i:saturday|sunday)/" "(?i:saturday|sunday)" nil nil nil nil "SunDay" nil "SunDay" nil) +(1005 "\"abcx\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "abcx" nil "abcx" ("abc")) +(1006 "\"aBCx\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "aBCx" nil "aBCx" ("aBC")) +(1007 "\"bbx\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "bbx" nil "bbx" ("bb")) +(1008 "\"BBx\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "BBx" nil "BBx" ("BB")) (1009 "\"abcX\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "abcX" nil nil nil) (1010 "\"aBCX\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "aBCX" nil nil nil) (1011 "\"bbX\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "bbX" nil nil nil) (1012 "\"BBX\" =~ /(a(?i)bc|BB)x/" "(a(?i)bc|BB)x" nil nil nil nil "BBX" nil nil nil) -(1013 "\"ac\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "ac" nil "ac" ("ac" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1014 "\"aC\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "aC" nil "aC" ("aC" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1015 "\"bD\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "bD" nil "bD" ("bD" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1016 "\"elephant\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "elephant" nil "e" ("e" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1017 "\"Europe\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "Europe" nil "E" ("E" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1018 "\"frog\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "frog" nil "f" ("f" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1019 "\"France\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "France" nil "F" ("F" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1013 "\"ac\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "ac" nil "ac" ("ac")) +(1014 "\"aC\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "aC" nil "aC" ("aC")) +(1015 "\"bD\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "bD" nil "bD" ("bD")) +(1016 "\"elephant\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "elephant" nil "e" ("e")) +(1017 "\"Europe\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "Europe" nil "E" ("E")) +(1018 "\"frog\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "frog" nil "f" ("f")) +(1019 "\"France\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "France" nil "F" ("F")) (1020 "\"Africa\" =~ /^([ab](?i)[cd]|[ef])/" "^([ab](?i)[cd]|[ef])" nil nil nil nil "Africa" nil nil nil) -(1021 "\"ab\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "ab" nil "ab" ("ab" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1022 "\"aBd\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "aBd" nil "aBd" ("aBd" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1023 "\"xy\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "xy" nil "xy" ("xy" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1024 "\"xY\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "xY" nil "xY" ("xY" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1025 "\"zebra\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "zebra" nil "z" ("z" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1026 "\"Zambesi\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "Zambesi" nil "Z" ("Z" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1021 "\"ab\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "ab" nil "ab" ("ab")) +(1022 "\"aBd\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "aBd" nil "aBd" ("aBd")) +(1023 "\"xy\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "xy" nil "xy" ("xy")) +(1024 "\"xY\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "xY" nil "xY" ("xY")) +(1025 "\"zebra\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "zebra" nil "z" ("z")) +(1026 "\"Zambesi\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "Zambesi" nil "Z" ("Z")) (1027 "\"aCD\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "aCD" nil nil nil) (1028 "\"XY\" =~ /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/" "^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)" nil nil nil nil "XY" nil nil nil) (1029 "\"foo\\nbar\" =~ /(?<=foo\\n)^bar/m" "(?<=foo\\n)^bar" nil t nil nil "foo -bar" nil "bar" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +bar" nil "bar" nil) (1030 "\"bar\" =~ /(?<=foo\\n)^bar/m" "(?<=foo\\n)^bar" nil t nil nil "bar" nil nil nil) (1031 "\"baz\\nbar\" =~ /(?<=foo\\n)^bar/m" "(?<=foo\\n)^bar" nil t nil nil "baz bar" nil nil nil) -(1032 "\"barbaz\" =~ /(?<=(?]&/" "^[<>]&" nil nil nil nil "<&OUT" nil "<&" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1369 "\"aaaaaaaaaa\" =~ /^(a\\1?){4}$/" "^(a\\1?){4}$" nil nil nil nil "aaaaaaaaaa" nil "aaaaaaaaaa" ("aaaa" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1339 "\"MULTIPLE WORDS, YEAH\" =~ /multiple words/i" "multiple words" t nil nil nil "MULTIPLE WORDS, YEAH" nil "MULTIPLE WORDS" nil) +(1340 "\"ABCDE\" =~ /(.*)c(.*)/i" "(.*)c(.*)" t nil nil nil "ABCDE" nil "ABCDE" ("AB" "DE")) +(1341 "\"(A, B)\" =~ /\\((.*), (.*)\\)/i" "\\((.*), (.*)\\)" t nil nil nil "(A, B)" nil "(A, B)" ("A" "B")) +(1342 "\"ABCD\" =~ /abcd/i" "abcd" t nil nil nil "ABCD" nil "ABCD" nil) +(1343 "\"ABCD\" =~ /a(bc)d/i" "a(bc)d" t nil nil nil "ABCD" nil "ABCD" ("BC")) +(1344 "\"AC\" =~ /a[-]?c/i" "a[-]?c" t nil nil nil "AC" nil "AC" nil) +(1345 "\"ABCABC\" =~ /(abc)\\1/i" "(abc)\\1" t nil nil nil "ABCABC" nil "ABCABC" ("ABC")) +(1346 "\"ABCABC\" =~ /([a-c]*)\\1/i" "([a-c]*)\\1" t nil nil nil "ABCABC" nil "ABCABC" ("ABC")) +(1347 "\"abad\" =~ /a(?!b)./" "a(?!b)." nil nil nil nil "abad" nil "ad" nil) +(1348 "\"abad\" =~ /a(?=d)./" "a(?=d)." nil nil nil nil "abad" nil "ad" nil) +(1349 "\"abad\" =~ /a(?=c|d)./" "a(?=c|d)." nil nil nil nil "abad" nil "ad" nil) +(1350 "\"ace\" =~ /a(?:b|c|d)(.)/" "a(?:b|c|d)(.)" nil nil nil nil "ace" nil "ace" ("e")) +(1351 "\"ace\" =~ /a(?:b|c|d)*(.)/" "a(?:b|c|d)*(.)" nil nil nil nil "ace" nil "ace" ("e")) +(1352 "\"ace\" =~ /a(?:b|c|d)+?(.)/" "a(?:b|c|d)+?(.)" nil nil nil nil "ace" nil "ace" ("e")) +(1353 "\"acdbcdbe\" =~ /a(?:b|c|d)+?(.)/" "a(?:b|c|d)+?(.)" nil nil nil nil "acdbcdbe" nil "acd" ("d")) +(1354 "\"acdbcdbe\" =~ /a(?:b|c|d)+(.)/" "a(?:b|c|d)+(.)" nil nil nil nil "acdbcdbe" nil "acdbcdbe" ("e")) +(1355 "\"acdbcdbe\" =~ /a(?:b|c|d){2}(.)/" "a(?:b|c|d){2}(.)" nil nil nil nil "acdbcdbe" nil "acdb" ("b")) +(1356 "\"acdbcdbe\" =~ /a(?:b|c|d){4,5}(.)/" "a(?:b|c|d){4,5}(.)" nil nil nil nil "acdbcdbe" nil "acdbcdb" ("b")) +(1357 "\"acdbcdbe\" =~ /a(?:b|c|d){4,5}?(.)/" "a(?:b|c|d){4,5}?(.)" nil nil nil nil "acdbcdbe" nil "acdbcd" ("d")) +(1358 "\"foobar\" =~ /((foo)|(bar))*/" "((foo)|(bar))*" nil nil nil nil "foobar" nil "foobar" ("bar" "foo" "bar")) +(1359 "\"acdbcdbe\" =~ /a(?:b|c|d){6,7}(.)/" "a(?:b|c|d){6,7}(.)" nil nil nil nil "acdbcdbe" nil "acdbcdbe" ("e")) +(1360 "\"acdbcdbe\" =~ /a(?:b|c|d){6,7}?(.)/" "a(?:b|c|d){6,7}?(.)" nil nil nil nil "acdbcdbe" nil "acdbcdbe" ("e")) +(1361 "\"acdbcdbe\" =~ /a(?:b|c|d){5,6}(.)/" "a(?:b|c|d){5,6}(.)" nil nil nil nil "acdbcdbe" nil "acdbcdbe" ("e")) +(1362 "\"acdbcdbe\" =~ /a(?:b|c|d){5,6}?(.)/" "a(?:b|c|d){5,6}?(.)" nil nil nil nil "acdbcdbe" nil "acdbcdb" ("b")) +(1363 "\"acdbcdbe\" =~ /a(?:b|c|d){5,7}(.)/" "a(?:b|c|d){5,7}(.)" nil nil nil nil "acdbcdbe" nil "acdbcdbe" ("e")) +(1364 "\"acdbcdbe\" =~ /a(?:b|c|d){5,7}?(.)/" "a(?:b|c|d){5,7}?(.)" nil nil nil nil "acdbcdbe" nil "acdbcdb" ("b")) +(1365 "\"ace\" =~ /a(?:b|(c|e){1,2}?|d)+?(.)/" "a(?:b|(c|e){1,2}?|d)+?(.)" nil nil nil nil "ace" nil "ace" ("c" "e")) +(1366 "\"AB\" =~ /^(.+)?B/" "^(.+)?B" nil nil nil nil "AB" nil "AB" ("A")) +(1367 "\".\" =~ /^([^a-z])|(\\^)$/" "^([^a-z])|(\\^)$" nil nil nil nil "." nil "." (".")) +(1368 "\"<&OUT\" =~ /^[<>]&/" "^[<>]&" nil nil nil nil "<&OUT" nil "<&" nil) +(1369 "\"aaaaaaaaaa\" =~ /^(a\\1?){4}$/" "^(a\\1?){4}$" nil nil nil nil "aaaaaaaaaa" nil "aaaaaaaaaa" ("aaaa")) (1370 "\"AB\" =~ /^(a\\1?){4}$/" "^(a\\1?){4}$" nil nil nil nil "AB" nil nil nil) (1371 "\"aaaaaaaaa\" =~ /^(a\\1?){4}$/" "^(a\\1?){4}$" nil nil nil nil "aaaaaaaaa" nil nil nil) (1372 "\"aaaaaaaaaaa\" =~ /^(a\\1?){4}$/" "^(a\\1?){4}$" nil nil nil nil "aaaaaaaaaaa" nil nil nil) -(1373 "\"aaaaaaaaaa\" =~ /^(a(?(1)\\1)){4}$/" "^(a(?(1)\\1)){4}$" nil nil nil nil "aaaaaaaaaa" nil "aaaaaaaaaa" ("aaaa" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1373 "\"aaaaaaaaaa\" =~ /^(a(?(1)\\1)){4}$/" "^(a(?(1)\\1)){4}$" nil nil nil nil "aaaaaaaaaa" nil "aaaaaaaaaa" ("aaaa")) (1374 "\"aaaaaaaaa\" =~ /^(a(?(1)\\1)){4}$/" "^(a(?(1)\\1)){4}$" nil nil nil nil "aaaaaaaaa" nil nil nil) (1375 "\"aaaaaaaaaaa\" =~ /^(a(?(1)\\1)){4}$/" "^(a(?(1)\\1)){4}$" nil nil nil nil "aaaaaaaaaaa" nil nil nil) -(1376 "\"foobar\" =~ /(?:(f)(o)(o)|(b)(a)(r))*/" "(?:(f)(o)(o)|(b)(a)(r))*" nil nil nil nil "foobar" nil "foobar" ("f" "o" "o" "b" "a" "r" nil nil nil nil nil nil nil nil nil nil)) -(1377 "\"ab\" =~ /(?<=a)b/" "(?<=a)b" nil nil nil nil "ab" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1376 "\"foobar\" =~ /(?:(f)(o)(o)|(b)(a)(r))*/" "(?:(f)(o)(o)|(b)(a)(r))*" nil nil nil nil "foobar" nil "foobar" ("f" "o" "o" "b" "a" "r")) +(1377 "\"ab\" =~ /(?<=a)b/" "(?<=a)b" nil nil nil nil "ab" nil "b" nil) (1378 "\"cb\" =~ /(?<=a)b/" "(?<=a)b" nil nil nil nil "cb" nil nil nil) (1379 "\"b\" =~ /(?<=a)b/" "(?<=a)b" nil nil nil nil "b" nil nil nil) -(1380 "\"ab\" =~ /(?a+)b/" "(?>a+)b" nil nil nil nil "aaab" nil "aaab" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1491 "\"a:[b]:\" =~ /([[:]+)/" "([[:]+)" nil nil nil nil "a:[b]:" nil ":[" (":[" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1492 "\"a=[b]=\" =~ /([[=]+)/" "([[=]+)" nil nil nil nil "a=[b]=" nil "=[" ("=[" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1493 "\"a.[b].\" =~ /([[.]+)/" "([[.]+)" nil nil nil nil "a.[b]." nil ".[" (".[" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1494 "\"aaab\" =~ /((?>a+)b)/" "((?>a+)b)" nil nil nil nil "aaab" nil "aaab" ("aaab" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1495 "\"aaab\" =~ /(?>(a+))b/" "(?>(a+))b" nil nil nil nil "aaab" nil "aaab" ("aaa" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1496 "\"((abc(ade)ufh()()x\" =~ /((?>[^()]+)|\\([^()]*\\))+/" "((?>[^()]+)|\\([^()]*\\))+" nil nil nil nil "((abc(ade)ufh()()x" nil "abc(ade)ufh()()x" ("x" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1489 "\"aexycd\" =~ /^[^bcd]*(c+)/" "^[^bcd]*(c+)" nil nil nil nil "aexycd" nil "aexyc" ("c")) +(1490 "\"aaab\" =~ /(?>a+)b/" "(?>a+)b" nil nil nil nil "aaab" nil "aaab" nil) +(1491 "\"a:[b]:\" =~ /([[:]+)/" "([[:]+)" nil nil nil nil "a:[b]:" nil ":[" (":[")) +(1492 "\"a=[b]=\" =~ /([[=]+)/" "([[=]+)" nil nil nil nil "a=[b]=" nil "=[" ("=[")) +(1493 "\"a.[b].\" =~ /([[.]+)/" "([[.]+)" nil nil nil nil "a.[b]." nil ".[" (".[")) +(1494 "\"aaab\" =~ /((?>a+)b)/" "((?>a+)b)" nil nil nil nil "aaab" nil "aaab" ("aaab")) +(1495 "\"aaab\" =~ /(?>(a+))b/" "(?>(a+))b" nil nil nil nil "aaab" nil "aaab" ("aaa")) +(1496 "\"((abc(ade)ufh()()x\" =~ /((?>[^()]+)|\\([^()]*\\))+/" "((?>[^()]+)|\\([^()]*\\))+" nil nil nil nil "((abc(ade)ufh()()x" nil "abc(ade)ufh()()x" ("x")) (1497 "\"aaab\" =~ /a\\Z/" "a\\Z" nil nil nil nil "aaab" nil nil nil) (1498 "\"a\\nb\\n\" =~ /a\\Z/" "a\\Z" nil nil nil nil "a b " nil nil nil) (1499 "\"a\\nb\\n\" =~ /b\\Z/" "b\\Z" nil nil nil nil "a b -" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" nil "b" nil) (1500 "\"a\\nb\" =~ /b\\Z/" "b\\Z" nil nil nil nil "a -b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +b" nil "b" nil) (1501 "\"a\\nb\" =~ /b\\z/" "b\\z" nil nil nil nil "a -b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1502 "\"a\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "a" nil "a" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1503 "\"abc\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "abc" nil "abc" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1504 "\"a-b\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "a-b" nil "a-b" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1505 "\"0-9\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "0-9" nil "0-9" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1506 "\"a.b\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "a.b" nil "a.b" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1507 "\"5.6.7\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "5.6.7" nil "5.6.7" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1508 "\"the.quick.brown.fox\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "the.quick.brown.fox" nil "the.quick.brown.fox" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1509 "\"a100.b200.300c\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "a100.b200.300c" nil "a100.b200.300c" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1510 "\"12-ab.1245\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "12-ab.1245" nil "12-ab.1245" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +b" nil "b" nil) +(1502 "\"a\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "a" nil "a" ("")) +(1503 "\"abc\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "abc" nil "abc" ("")) +(1504 "\"a-b\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "a-b" nil "a-b" ("")) +(1505 "\"0-9\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "0-9" nil "0-9" ("")) +(1506 "\"a.b\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "a.b" nil "a.b" ("")) +(1507 "\"5.6.7\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "5.6.7" nil "5.6.7" ("")) +(1508 "\"the.quick.brown.fox\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "the.quick.brown.fox" nil "the.quick.brown.fox" ("")) +(1509 "\"a100.b200.300c\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "a100.b200.300c" nil "a100.b200.300c" ("")) +(1510 "\"12-ab.1245\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "12-ab.1245" nil "12-ab.1245" ("")) (1511 "\"\\\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "" nil nil nil) (1512 "\".a\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil ".a" nil nil nil) (1513 "\"-a\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "-a" nil nil nil) @@ -14100,23 +14100,23 @@ b" nil "b" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) (1521 "\"the.quick.brown.fox.\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "the.quick.brown.fox." nil nil nil) (1522 "\"the.quick.brown.fox_\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "the.quick.brown.fox_" nil nil nil) (1523 "\"the.quick.brown.fox+\" =~ /^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$/" "^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$" nil nil nil nil "the.quick.brown.fox+" nil nil nil) -(1524 "\"alphabetabcd\" =~ /(?>.*)(?<=(abcd|wxyz))/" "(?>.*)(?<=(abcd|wxyz))" nil nil nil nil "alphabetabcd" nil "alphabetabcd" ("abcd" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1525 "\"endingwxyz\" =~ /(?>.*)(?<=(abcd|wxyz))/" "(?>.*)(?<=(abcd|wxyz))" nil nil nil nil "endingwxyz" nil "endingwxyz" ("wxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1524 "\"alphabetabcd\" =~ /(?>.*)(?<=(abcd|wxyz))/" "(?>.*)(?<=(abcd|wxyz))" nil nil nil nil "alphabetabcd" nil "alphabetabcd" ("abcd")) +(1525 "\"endingwxyz\" =~ /(?>.*)(?<=(abcd|wxyz))/" "(?>.*)(?<=(abcd|wxyz))" nil nil nil nil "endingwxyz" nil "endingwxyz" ("wxyz")) (1526 "\"a rather long string that doesn't end with one of them\" =~ /(?>.*)(?<=(abcd|wxyz))/" "(?>.*)(?<=(abcd|wxyz))" nil nil nil nil "a rather long string that doesn't end with one of them" nil nil nil) -(1527 "\"word cat dog elephant mussel cow horse canary baboon snake shark otherword\" =~ /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/" "word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword" nil nil nil nil "word cat dog elephant mussel cow horse canary baboon snake shark otherword" nil "word cat dog elephant mussel cow horse canary baboon snake shark otherword" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1527 "\"word cat dog elephant mussel cow horse canary baboon snake shark otherword\" =~ /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/" "word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword" nil nil nil nil "word cat dog elephant mussel cow horse canary baboon snake shark otherword" nil "word cat dog elephant mussel cow horse canary baboon snake shark otherword" nil) (1528 "\"word cat dog elephant mussel cow horse canary baboon snake shark\" =~ /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/" "word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword" nil nil nil nil "word cat dog elephant mussel cow horse canary baboon snake shark" nil nil nil) (1529 "\"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope\" =~ /word (?>[a-zA-Z0-9]+ ){0,30}otherword/" "word (?>[a-zA-Z0-9]+ ){0,30}otherword" nil nil nil nil "word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope" nil nil nil) -(1530 "\"999foo\" =~ /(?<=\\d{3}(?!999))foo/" "(?<=\\d{3}(?!999))foo" nil nil nil nil "999foo" nil "foo" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1531 "\"123999foo\" =~ /(?<=\\d{3}(?!999))foo/" "(?<=\\d{3}(?!999))foo" nil nil nil nil "123999foo" nil "foo" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1530 "\"999foo\" =~ /(?<=\\d{3}(?!999))foo/" "(?<=\\d{3}(?!999))foo" nil nil nil nil "999foo" nil "foo" nil) +(1531 "\"123999foo\" =~ /(?<=\\d{3}(?!999))foo/" "(?<=\\d{3}(?!999))foo" nil nil nil nil "123999foo" nil "foo" nil) (1532 "\"123abcfoo\" =~ /(?<=\\d{3}(?!999))foo/" "(?<=\\d{3}(?!999))foo" nil nil nil nil "123abcfoo" nil nil nil) -(1533 "\"999foo\" =~ /(?<=(?!...999)\\d{3})foo/" "(?<=(?!...999)\\d{3})foo" nil nil nil nil "999foo" nil "foo" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1534 "\"123999foo\" =~ /(?<=(?!...999)\\d{3})foo/" "(?<=(?!...999)\\d{3})foo" nil nil nil nil "123999foo" nil "foo" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1533 "\"999foo\" =~ /(?<=(?!...999)\\d{3})foo/" "(?<=(?!...999)\\d{3})foo" nil nil nil nil "999foo" nil "foo" nil) +(1534 "\"123999foo\" =~ /(?<=(?!...999)\\d{3})foo/" "(?<=(?!...999)\\d{3})foo" nil nil nil nil "123999foo" nil "foo" nil) (1535 "\"123abcfoo\" =~ /(?<=(?!...999)\\d{3})foo/" "(?<=(?!...999)\\d{3})foo" nil nil nil nil "123abcfoo" nil nil nil) -(1536 "\"123abcfoo\" =~ /(?<=\\d{3}(?!999)...)foo/" "(?<=\\d{3}(?!999)...)foo" nil nil nil nil "123abcfoo" nil "foo" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1537 "\"123456foo\" =~ /(?<=\\d{3}(?!999)...)foo/" "(?<=\\d{3}(?!999)...)foo" nil nil nil nil "123456foo" nil "foo" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1536 "\"123abcfoo\" =~ /(?<=\\d{3}(?!999)...)foo/" "(?<=\\d{3}(?!999)...)foo" nil nil nil nil "123abcfoo" nil "foo" nil) +(1537 "\"123456foo\" =~ /(?<=\\d{3}(?!999)...)foo/" "(?<=\\d{3}(?!999)...)foo" nil nil nil nil "123456foo" nil "foo" nil) (1538 "\"123999foo\" =~ /(?<=\\d{3}(?!999)...)foo/" "(?<=\\d{3}(?!999)...)foo" nil nil nil nil "123999foo" nil nil nil) -(1539 "\"123abcfoo\" =~ /(?<=\\d{3}...)(?\\s*)=(?>\\s*) # find
\\s*)=(?>\\s*) # find \\s*)=(?>\\s*) # find Z)+|A)*/" "((?>Z)+|A)*" nil nil nil nil "ZABCDEFG" nil "ZA" ("A" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1555 "\"ZABCDEFG\" =~ /((?>)+|A)*/" "((?>)+|A)*" nil nil nil nil "ZABCDEFG" nil "" ("" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1556 "\"abbab\" =~ /a*/" "a*" nil nil nil nil "abbab" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1557 "\"abcde\" =~ /^[a-\\d]/" "^[a-\\d]" nil nil nil nil "abcde" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1558 "\"-things\" =~ /^[a-\\d]/" "^[a-\\d]" nil nil nil nil "-things" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1559 "\"0digit\" =~ /^[a-\\d]/" "^[a-\\d]" nil nil nil nil "0digit" nil "0" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +" t nil t t "Z)+|A)*/" "((?>Z)+|A)*" nil nil nil nil "ZABCDEFG" nil "ZA" ("A")) +(1555 "\"ZABCDEFG\" =~ /((?>)+|A)*/" "((?>)+|A)*" nil nil nil nil "ZABCDEFG" nil "" ("")) +(1556 "\"abbab\" =~ /a*/" "a*" nil nil nil nil "abbab" nil "a" nil) +(1557 "\"abcde\" =~ /^[a-\\d]/" "^[a-\\d]" nil nil nil nil "abcde" nil "a" nil) +(1558 "\"-things\" =~ /^[a-\\d]/" "^[a-\\d]" nil nil nil nil "-things" nil "-" nil) +(1559 "\"0digit\" =~ /^[a-\\d]/" "^[a-\\d]" nil nil nil nil "0digit" nil "0" nil) (1560 "\"bcdef\" =~ /^[a-\\d]/" "^[a-\\d]" nil nil nil nil "bcdef" nil nil nil) -(1561 "\"abcde\" =~ /^[\\d-a]/" "^[\\d-a]" nil nil nil nil "abcde" nil "a" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1562 "\"-things\" =~ /^[\\d-a]/" "^[\\d-a]" nil nil nil nil "-things" nil "-" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1563 "\"0digit\" =~ /^[\\d-a]/" "^[\\d-a]" nil nil nil nil "0digit" nil "0" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1561 "\"abcde\" =~ /^[\\d-a]/" "^[\\d-a]" nil nil nil nil "abcde" nil "a" nil) +(1562 "\"-things\" =~ /^[\\d-a]/" "^[\\d-a]" nil nil nil nil "-things" nil "-" nil) +(1563 "\"0digit\" =~ /^[\\d-a]/" "^[\\d-a]" nil nil nil nil "0digit" nil "0" nil) (1564 "\"bcdef\" =~ /^[\\d-a]/" "^[\\d-a]" nil nil nil nil "bcdef" nil nil nil) -(1565 "\"abcdef\" =~ /(?<=abc).*(?=def)/" "(?<=abc).*(?=def)" nil nil nil nil "abcdef" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1566 "\"abcxdef\" =~ /(?<=abc).*(?=def)/" "(?<=abc).*(?=def)" nil nil nil nil "abcxdef" nil "x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1567 "\"abcxdefxdef\" =~ /(?<=abc).*(?=def)/" "(?<=abc).*(?=def)" nil nil nil nil "abcxdefxdef" nil "xdefx" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1568 "\"abcdef\" =~ /(?<=abc).*?(?=def)/" "(?<=abc).*?(?=def)" nil nil nil nil "abcdef" nil "" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1569 "\"abcxdef\" =~ /(?<=abc).*?(?=def)/" "(?<=abc).*?(?=def)" nil nil nil nil "abcxdef" nil "x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1570 "\"abcxdefxdef\" =~ /(?<=abc).*?(?=def)/" "(?<=abc).*?(?=def)" nil nil nil nil "abcxdefxdef" nil "x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1565 "\"abcdef\" =~ /(?<=abc).*(?=def)/" "(?<=abc).*(?=def)" nil nil nil nil "abcdef" nil "" nil) +(1566 "\"abcxdef\" =~ /(?<=abc).*(?=def)/" "(?<=abc).*(?=def)" nil nil nil nil "abcxdef" nil "x" nil) +(1567 "\"abcxdefxdef\" =~ /(?<=abc).*(?=def)/" "(?<=abc).*(?=def)" nil nil nil nil "abcxdefxdef" nil "xdefx" nil) +(1568 "\"abcdef\" =~ /(?<=abc).*?(?=def)/" "(?<=abc).*?(?=def)" nil nil nil nil "abcdef" nil "" nil) +(1569 "\"abcxdef\" =~ /(?<=abc).*?(?=def)/" "(?<=abc).*?(?=def)" nil nil nil nil "abcxdef" nil "x" nil) +(1570 "\"abcxdefxdef\" =~ /(?<=abc).*?(?=def)/" "(?<=abc).*?(?=def)" nil nil nil nil "abcxdefxdef" nil "x" nil) (1571 "\"abcdef\" =~ /(?<=abc).+(?=def)/" "(?<=abc).+(?=def)" nil nil nil nil "abcdef" nil nil nil) -(1572 "\"abcxdef\" =~ /(?<=abc).+(?=def)/" "(?<=abc).+(?=def)" nil nil nil nil "abcxdef" nil "x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1573 "\"abcxdefxdef\" =~ /(?<=abc).+(?=def)/" "(?<=abc).+(?=def)" nil nil nil nil "abcxdefxdef" nil "xdefx" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1572 "\"abcxdef\" =~ /(?<=abc).+(?=def)/" "(?<=abc).+(?=def)" nil nil nil nil "abcxdef" nil "x" nil) +(1573 "\"abcxdefxdef\" =~ /(?<=abc).+(?=def)/" "(?<=abc).+(?=def)" nil nil nil nil "abcxdefxdef" nil "xdefx" nil) (1574 "\"abcdef\" =~ /(?<=abc).+?(?=def)/" "(?<=abc).+?(?=def)" nil nil nil nil "abcdef" nil nil nil) -(1575 "\"abcxdef\" =~ /(?<=abc).+?(?=def)/" "(?<=abc).+?(?=def)" nil nil nil nil "abcxdef" nil "x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1576 "\"abcxdefxdef\" =~ /(?<=abc).+?(?=def)/" "(?<=abc).+?(?=def)" nil nil nil nil "abcxdefxdef" nil "x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1577 "\"-abcdef\" =~ /(?<=\\b)(.*)/" "(?<=\\b)(.*)" nil nil nil nil "-abcdef" nil "abcdef" ("abcdef" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1578 "\"abcdef\" =~ /(?<=\\b)(.*)/" "(?<=\\b)(.*)" nil nil nil nil "abcdef" nil "abcdef" ("abcdef" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1579 "\"-abcdef\" =~ /(?<=\\B)(.*)/" "(?<=\\B)(.*)" nil nil nil nil "-abcdef" nil "-abcdef" ("-abcdef" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1580 "\"abcdef\" =~ /(?<=\\B)(.*)/" "(?<=\\B)(.*)" nil nil nil nil "abcdef" nil "bcdef" ("bcdef" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1581 "\"'a'\" =~ /^'[ab]'/" "^'[ab]'" nil nil nil nil "'a'" nil "'a'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1582 "\"'b'\" =~ /^'[ab]'/" "^'[ab]'" nil nil nil nil "'b'" nil "'b'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1575 "\"abcxdef\" =~ /(?<=abc).+?(?=def)/" "(?<=abc).+?(?=def)" nil nil nil nil "abcxdef" nil "x" nil) +(1576 "\"abcxdefxdef\" =~ /(?<=abc).+?(?=def)/" "(?<=abc).+?(?=def)" nil nil nil nil "abcxdefxdef" nil "x" nil) +(1577 "\"-abcdef\" =~ /(?<=\\b)(.*)/" "(?<=\\b)(.*)" nil nil nil nil "-abcdef" nil "abcdef" ("abcdef")) +(1578 "\"abcdef\" =~ /(?<=\\b)(.*)/" "(?<=\\b)(.*)" nil nil nil nil "abcdef" nil "abcdef" ("abcdef")) +(1579 "\"-abcdef\" =~ /(?<=\\B)(.*)/" "(?<=\\B)(.*)" nil nil nil nil "-abcdef" nil "-abcdef" ("-abcdef")) +(1580 "\"abcdef\" =~ /(?<=\\B)(.*)/" "(?<=\\B)(.*)" nil nil nil nil "abcdef" nil "bcdef" ("bcdef")) +(1581 "\"'a'\" =~ /^'[ab]'/" "^'[ab]'" nil nil nil nil "'a'" nil "'a'" nil) +(1582 "\"'b'\" =~ /^'[ab]'/" "^'[ab]'" nil nil nil nil "'b'" nil "'b'" nil) (1583 "\"x'a'\" =~ /^'[ab]'/" "^'[ab]'" nil nil nil nil "x'a'" nil nil nil) -(1584 "\"'a'x\" =~ /^'[ab]'/" "^'[ab]'" nil nil nil nil "'a'x" nil "'a'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1584 "\"'a'x\" =~ /^'[ab]'/" "^'[ab]'" nil nil nil nil "'a'x" nil "'a'" nil) (1585 "\"'ab'\" =~ /^'[ab]'/" "^'[ab]'" nil nil nil nil "'ab'" nil nil nil) -(1586 "\"'a'\" =~ /^'[ab]'$/" "^'[ab]'$" nil nil nil nil "'a'" nil "'a'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1587 "\"'b'\" =~ /^'[ab]'$/" "^'[ab]'$" nil nil nil nil "'b'" nil "'b'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1586 "\"'a'\" =~ /^'[ab]'$/" "^'[ab]'$" nil nil nil nil "'a'" nil "'a'" nil) +(1587 "\"'b'\" =~ /^'[ab]'$/" "^'[ab]'$" nil nil nil nil "'b'" nil "'b'" nil) (1588 "\"x'a'\" =~ /^'[ab]'$/" "^'[ab]'$" nil nil nil nil "x'a'" nil nil nil) (1589 "\"'a'x\" =~ /^'[ab]'$/" "^'[ab]'$" nil nil nil nil "'a'x" nil nil nil) (1590 "\"'ab'\" =~ /^'[ab]'$/" "^'[ab]'$" nil nil nil nil "'ab'" nil nil nil) -(1591 "\"'a'\" =~ /'[ab]'$/" "'[ab]'$" nil nil nil nil "'a'" nil "'a'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1592 "\"'b'\" =~ /'[ab]'$/" "'[ab]'$" nil nil nil nil "'b'" nil "'b'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1593 "\"x'a'\" =~ /'[ab]'$/" "'[ab]'$" nil nil nil nil "x'a'" nil "'a'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1591 "\"'a'\" =~ /'[ab]'$/" "'[ab]'$" nil nil nil nil "'a'" nil "'a'" nil) +(1592 "\"'b'\" =~ /'[ab]'$/" "'[ab]'$" nil nil nil nil "'b'" nil "'b'" nil) +(1593 "\"x'a'\" =~ /'[ab]'$/" "'[ab]'$" nil nil nil nil "x'a'" nil "'a'" nil) (1594 "\"'a'x\" =~ /'[ab]'$/" "'[ab]'$" nil nil nil nil "'a'x" nil nil nil) (1595 "\"'ab'\" =~ /'[ab]'$/" "'[ab]'$" nil nil nil nil "'ab'" nil nil nil) -(1596 "\"'a'\" =~ /'[ab]'/" "'[ab]'" nil nil nil nil "'a'" nil "'a'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1597 "\"'b'\" =~ /'[ab]'/" "'[ab]'" nil nil nil nil "'b'" nil "'b'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1598 "\"x'a'\" =~ /'[ab]'/" "'[ab]'" nil nil nil nil "x'a'" nil "'a'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1599 "\"'a'x\" =~ /'[ab]'/" "'[ab]'" nil nil nil nil "'a'x" nil "'a'" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1596 "\"'a'\" =~ /'[ab]'/" "'[ab]'" nil nil nil nil "'a'" nil "'a'" nil) +(1597 "\"'b'\" =~ /'[ab]'/" "'[ab]'" nil nil nil nil "'b'" nil "'b'" nil) +(1598 "\"x'a'\" =~ /'[ab]'/" "'[ab]'" nil nil nil nil "x'a'" nil "'a'" nil) +(1599 "\"'a'x\" =~ /'[ab]'/" "'[ab]'" nil nil nil nil "'a'x" nil "'a'" nil) (1600 "\"'ab'\" =~ /'[ab]'/" "'[ab]'" nil nil nil nil "'ab'" nil nil nil) -(1601 "\"abc\" =~ /abc\\E/" "abc\\E" nil nil nil nil "abc" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1602 "\"abcE\" =~ /abc\\E/" "abc\\E" nil nil nil nil "abcE" nil "abc" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1603 "\"abcx\" =~ /abc[\\Ex]/" "abc[\\Ex]" nil nil nil nil "abcx" nil "abcx" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1601 "\"abc\" =~ /abc\\E/" "abc\\E" nil nil nil nil "abc" nil "abc" nil) +(1602 "\"abcE\" =~ /abc\\E/" "abc\\E" nil nil nil nil "abcE" nil "abc" nil) +(1603 "\"abcx\" =~ /abc[\\Ex]/" "abc[\\Ex]" nil nil nil nil "abcx" nil "abcx" nil) (1604 "\"abcE\" =~ /abc[\\Ex]/" "abc[\\Ex]" nil nil nil nil "abcE" nil nil nil) -(1605 "\"a*\" =~ /^\\Qa*\\E$/" "^\\Qa*\\E$" nil nil nil nil "a*" nil "a*" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1605 "\"a*\" =~ /^\\Qa*\\E$/" "^\\Qa*\\E$" nil nil nil nil "a*" nil "a*" nil) (1606 "\"a\" =~ /^\\Qa*\\E$/" "^\\Qa*\\E$" nil nil nil nil "a" nil nil nil) -(1607 "\"a*x\" =~ /\\Qa*x\\E/" "\\Qa*x\\E" nil nil nil nil "a*x" nil "a*x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1607 "\"a*x\" =~ /\\Qa*x\\E/" "\\Qa*x\\E" nil nil nil nil "a*x" nil "a*x" nil) (1608 "\"a*\" =~ /\\Qa*x\\E/" "\\Qa*x\\E" nil nil nil nil "a*" nil nil nil) -(1609 "\"a*x\" =~ /\\Qa*x/" "\\Qa*x" nil nil nil nil "a*x" nil "a*x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1609 "\"a*x\" =~ /\\Qa*x/" "\\Qa*x" nil nil nil nil "a*x" nil "a*x" nil) (1610 "\"a*\" =~ /\\Qa*x/" "\\Qa*x" nil nil nil nil "a*" nil nil nil) (1611 "\"a*x\" =~ /\\Q\\Qa*x\\E\\E/" "\\Q\\Qa*x\\E\\E" nil nil nil nil "a*x" nil nil nil) -(1612 "\"a\\\\*x\" =~ /\\Q\\Qa*x\\E\\E/" "\\Q\\Qa*x\\E\\E" nil nil nil nil "a\\*x" nil "a\\*x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1612 "\"a\\\\*x\" =~ /\\Q\\Qa*x\\E\\E/" "\\Q\\Qa*x\\E\\E" nil nil nil nil "a\\*x" nil "a\\*x" nil) (1613 "\"a*x\" =~ /\\Q\\Qa*x\\E/" "\\Q\\Qa*x\\E" nil nil nil nil "a*x" nil nil nil) -(1614 "\"a\\\\*x\" =~ /\\Q\\Qa*x\\E/" "\\Q\\Qa*x\\E" nil nil nil nil "a\\*x" nil "a\\*x" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1615 "\"a[x]\" =~ /a\\Q[x\\E]/" "a\\Q[x\\E]" nil nil nil nil "a[x]" nil "a[x]" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1614 "\"a\\\\*x\" =~ /\\Q\\Qa*x\\E/" "\\Q\\Qa*x\\E" nil nil nil nil "a\\*x" nil "a\\*x" nil) +(1615 "\"a[x]\" =~ /a\\Q[x\\E]/" "a\\Q[x\\E]" nil nil nil nil "a[x]" nil "a[x]" nil) (1616 "\"ax\" =~ /a\\Q[x\\E]/" "a\\Q[x\\E]" nil nil nil nil "ax" nil nil nil) (1617 "\"a\" =~ /a#comment\\Q... {2}/x" "a#comment\\Q... {2}" nil nil nil t "a" nil nil nil) (1618 "\"aa\" =~ /a#comment\\Q... {2}/x" "a#comment\\Q... -{2}" nil nil nil t "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +{2}" nil nil nil t "aa" nil "aa" nil) (1619 "\"a\" =~ /a(?#comment\\Q... ){2}/x" "a(?#comment\\Q... ){2}" nil nil nil t "a" nil nil nil) (1620 "\"aa\" =~ /a(?#comment\\Q... ){2}/x" "a(?#comment\\Q... -){2}" nil nil nil t "aa" nil "aa" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +){2}" nil nil nil t "aa" nil "aa" nil) (1621 "\"a.\" =~ /(?x)a#\\Q ./" "(?x)a#\\Q -." nil nil nil nil "a." nil "a." (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +." nil nil nil nil "a." nil "a." nil) (1622 "\"aa\" =~ /(?x)a#\\Q ./" "(?x)a#\\Q ." nil nil nil nil "aa" nil nil nil) -(1623 "\"abcdxklqj\" =~ /ab(?=.*q)cd/" "ab(?=.*q)cd" nil nil nil nil "abcdxklqj" nil "abcd" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1623 "\"abcdxklqj\" =~ /ab(?=.*q)cd/" "ab(?=.*q)cd" nil nil nil nil "abcdxklqj" nil "abcd" nil) (1624 "\"ab\" =~ /a(?!.*$)b/" "a(?!.*$)b" nil nil nil nil "ab" nil nil nil) -(1625 "\"Axi\" =~ /.{2}[a-z]/" ".{2}[a-z]" nil nil nil nil "Axi" nil "Axi" (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1626 "\"aaaaaaaaaac\" =~ /((a{0,5}){0,5}){0,5}c/" "((a{0,5}){0,5}){0,5}c" nil nil nil nil "aaaaaaaaaac" nil "aaaaaaaaaac" ("" "" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1625 "\"Axi\" =~ /.{2}[a-z]/" ".{2}[a-z]" nil nil nil nil "Axi" nil "Axi" nil) +(1626 "\"aaaaaaaaaac\" =~ /((a{0,5}){0,5}){0,5}c/" "((a{0,5}){0,5}){0,5}c" nil nil nil nil "aaaaaaaaaac" nil "aaaaaaaaaac" ("" "")) (1627 "\"aaaaaaaaaa\" =~ /((a{0,5}){0,5}){0,5}c/" "((a{0,5}){0,5}){0,5}c" nil nil nil nil "aaaaaaaaaa" nil nil nil) -(1628 "\"aaaaaaaaaac\" =~ /((a{0,5}){0,5})*c/" "((a{0,5}){0,5})*c" nil nil nil nil "aaaaaaaaaac" nil "aaaaaaaaaac" ("" "" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1628 "\"aaaaaaaaaac\" =~ /((a{0,5}){0,5})*c/" "((a{0,5}){0,5})*c" nil nil nil nil "aaaaaaaaaac" nil "aaaaaaaaaac" ("" "")) (1629 "\"aaaaaaaaaa\" =~ /((a{0,5}){0,5})*c/" "((a{0,5}){0,5})*c" nil nil nil nil "aaaaaaaaaa" nil nil nil) -(1630 "\"abd\" =~ /^(?=(?1))?[az]([abc])d/" "^(?=(?1))?[az]([abc])d" nil nil nil nil "abd" nil "abd" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1631 "\"zcdxx\" =~ /^(?=(?1))?[az]([abc])d/" "^(?=(?1))?[az]([abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1632 "\"abd\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "abd" nil "abd" ("b" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1633 "\"zcdxx\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1634 "\"abcabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1635 "\"xyzabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1636 "\"abcabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "abcabc" nil "abcabc" ("abc" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1637 "\"xyzabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1630 "\"abd\" =~ /^(?=(?1))?[az]([abc])d/" "^(?=(?1))?[az]([abc])d" nil nil nil nil "abd" nil "abd" ("b")) +(1631 "\"zcdxx\" =~ /^(?=(?1))?[az]([abc])d/" "^(?=(?1))?[az]([abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c")) +(1632 "\"abd\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "abd" nil "abd" ("b")) +(1633 "\"zcdxx\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c")) +(1634 "\"abcabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "abcabc" nil "abcabc" ("abc")) +(1635 "\"xyzabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz")) +(1636 "\"abcabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "abcabc" nil "abcabc" ("abc")) +(1637 "\"xyzabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz")) (1638 "\"XYabcdY\" =~ /^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/" "^X(?5)(a)(?:(b)|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) (1639 "\"XYabcdY\" =~ /^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/" "^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) (1640 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) (1641 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/" "^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) (1642 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) (1643 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/" "^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1644 "\"abc\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1645 "\"a(b)c\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1646 "\"a(b(c))d\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1647 "\"abc\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "abc" nil "abc" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1648 "\"a(b)c\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1649 "\"a(b(c))d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1650 "\">abc>123abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>123abc>123abc>1(2)3abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>(1(2)3)abc>(1(2)3)abc>123abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>123abc>123abc>1(2)3abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>(1(2)3)abc>(1(2)3)(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1661 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1662 "\"AmanaplanacanalPanama\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1663 "\"AblewasIereIsawElba\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A" nil nil nil nil nil nil nil nil nil nil nil nil)) -(1664 "\"12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1665 "\"(((2+2)*-3)-7)\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1666 "\"-12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1667 "\"12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "12" nil "12" ("12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1668 "\"(((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1669 "\"-12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "-12" nil "-12" ("-12" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1670 "\"xyz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1671 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1672 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1673 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1644 "\"abc\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "abc" nil "abc" ("c")) +(1645 "\"a(b)c\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c")) +(1646 "\"a(b(c))d\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d")) +(1647 "\"abc\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "abc" nil "abc" ("c")) +(1648 "\"a(b)c\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c")) +(1649 "\"a(b(c))d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d")) +(1650 "\">abc>123abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>123abc>123abc>1(2)3abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>(1(2)3)abc>(1(2)3)abc>123abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>123abc>123abc>1(2)3abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>(1(2)3)abc>(1(2)3)(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1")) +(1661 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S")) +(1662 "\"AmanaplanacanalPanama\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A")) +(1663 "\"AblewasIereIsawElba\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A")) +(1664 "\"12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "12" nil "12" ("12")) +(1665 "\"(((2+2)*-3)-7)\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-")) +(1666 "\"-12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "-12" nil "-12" ("-12")) +(1667 "\"12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "12" nil "12" ("12")) +(1668 "\"(((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-")) +(1669 "\"-12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "-12" nil "-12" ("-12")) +(1670 "\"xyz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y")) +(1671 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz")) +(1672 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y")) +(1673 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz")) (1674 "\"foo\" =~ /(?f)(?o)(?&foo)/" "(?f)(?o)(?&foo)" nil nil nil nil "foo" nil nil nil) -(1675 "\"fof\" =~ /(?f)(?o)(?&foo)/" "(?f)(?o)(?&foo)" nil nil nil nil "fof" nil "fof" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1676 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1677 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1678 "\"ofo\" =~ /(?2)(f)(o)/" "(?2)(f)(o)" nil nil nil nil "ofo" nil "ofo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) -(1679 "\"ofo\" =~ /(?&foo)(f)(?o)/" "(?&foo)(f)(?o)" nil nil nil nil "ofo" nil "ofo" ("f" "o" nil nil nil nil nil nil nil nil nil nil nil nil nil nil)) +(1675 "\"fof\" =~ /(?f)(?o)(?&foo)/" "(?f)(?o)(?&foo)" nil nil nil nil "fof" nil "fof" ("f" "o")) +(1676 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o")) +(1677 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o")) +(1678 "\"ofo\" =~ /(?2)(f)(o)/" "(?2)(f)(o)" nil nil nil nil "ofo" nil "ofo" ("f" "o")) +(1679 "\"ofo\" =~ /(?&foo)(f)(?o)/" "(?&foo)(f)(?o)" nil nil nil nil "ofo" nil "ofo" ("f" "o")) (1680 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) (1681 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) (1682 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) From 7bd7c2239617e5887b3a22c16d4376f73ac6f8ef Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 14 Jan 2014 19:11:26 -0500 Subject: [PATCH 057/130] Add two tests for double- and triple-digit register number subpattern references. --- test/perltestdata | 4 ++++ test/perltestinput | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index f6e703b..29810be 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14358,3 +14358,7 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1689 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) +(1690 "\"0123456789foofoo\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)" nil nil nil nil "0123456789foofoo" nil "0123456789foofoo" ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "foo")) +(1691 "\"0123456789foofor\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)" nil nil nil nil "0123456789foofor" nil nil nil) +(1692 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "foo")) +(1693 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor" nil nil nil) diff --git a/test/perltestinput b/test/perltestinput index b7e2d3c..0eddf99 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4088,3 +4088,11 @@ foo)/ /(?foo)(?&foo )/ foofoo + +/(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)/ + 0123456789foofoo + 0123456789foofor + +/(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/ + 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo + 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor From f4f81375b30194ede1a1dc343e324753840e08c8 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 14 Jan 2014 19:36:09 -0500 Subject: [PATCH 058/130] Remove comment about possibly supporting (?0) and (?R). These are not worth the time, especially considering that they're trivially easy to simulate. --- lexer.lisp | 1 - 1 file changed, 1 deletion(-) diff --git a/lexer.lisp b/lexer.lisp index cf59a5c..c79d8ac 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -715,7 +715,6 @@ will also be consumed." "Character '~A' may not follow '(?&'." next-char)))) ((#\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) - ;; FIXME: Add support for (?0), AKA (?R). ;; put the digit back (decf (lexer-pos lexer)) (prog1 From a37bf58f634e5cb50e0162fc2786a4c862fe231e Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 14 Jan 2014 20:08:22 -0500 Subject: [PATCH 059/130] Remove unneeded variable NAMED-REG-SEEN. We know a named reg has been seen when one or more of the elements of REG-NAMES is true. --- convert.lisp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/convert.lisp b/convert.lisp index bae356d..20b081c 100644 --- a/convert.lisp +++ b/convert.lisp @@ -589,9 +589,8 @@ when NAME is not NIL." ;; slot of the REGISTER object too (let ((flags (copy-list flags)) (stored-reg-num reg-num)) - (declare (special flags reg-seen named-reg-seen)) + (declare (special flags reg-seen)) (setq reg-seen t) - (when name (setq named-reg-seen t)) (incf (the fixnum reg-num)) (push name reg-names) ;; FIXME: While inside registers, we cannot indiscriminately accumulate into @@ -937,7 +936,6 @@ by subpattern references in the REGEX." (let* ((flags (list nil nil nil)) (reg-num 0) reg-names - named-reg-seen numbered-subpattern-refs named-subpattern-refs (accumulate-start-p t) @@ -947,7 +945,6 @@ by subpattern references in the REGEX." (converted-parse-tree (convert-aux parse-tree))) (declare (special flags reg-num reg-names - named-reg-seen accumulate-start-p starts-with max-back-ref @@ -978,7 +975,7 @@ by subpattern references in the REGEX." (values converted-parse-tree reg-num starts-with ;; we can't simply use *ALLOW-NAMED-REGISTERS* ;; since parse-tree syntax ignores it - (when named-reg-seen + (when (some #'identity reg-names) (nreverse reg-names)) (when numbered-subpattern-refs (nreverse numbered-subpattern-refs))))) From 8678c2be43bbb42ea519e048082bdb44d7ea71a1 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Wed, 15 Jan 2014 20:12:13 -0500 Subject: [PATCH 060/130] Add some failing tests taken from the pcre distribution. --- test/perltestdata | 128 +++++++++++++++++++++++++-------------------- test/perltestinput | 12 +++++ 2 files changed, 82 insertions(+), 58 deletions(-) diff --git a/test/perltestdata b/test/perltestdata index 29810be..aac1b03 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14296,69 +14296,81 @@ b" nil "b" nil) (1633 "\"zcdxx\" =~ /^(?=(?®One))?[az](?[abc])d/" "^(?=(?®One))?[az](?[abc])d" nil nil nil nil "zcdxx" nil "zcd" ("c")) (1634 "\"abcabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "abcabc" nil "abcabc" ("abc")) (1635 "\"xyzabc\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz")) -(1636 "\"abcabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "abcabc" nil "abcabc" ("abc")) -(1637 "\"xyzabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz")) -(1638 "\"XYabcdY\" =~ /^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/" "^X(?5)(a)(?:(b)|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1639 "\"XYabcdY\" =~ /^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/" "^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1640 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1641 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/" "^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1642 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1643 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/" "^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) -(1644 "\"abc\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "abc" nil "abc" ("c")) -(1645 "\"a(b)c\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c")) -(1646 "\"a(b(c))d\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d")) -(1647 "\"abc\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "abc" nil "abc" ("c")) -(1648 "\"a(b)c\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c")) -(1649 "\"a(b(c))d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d")) -(1650 "\">abc>123abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>123abc>123abc>1(2)3abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>(1(2)3)abc>(1(2)3)abc>123abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>123abc>123abc>1(2)3abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>(1(2)3)abc>(1(2)3)(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1")) -(1661 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S")) -(1662 "\"AmanaplanacanalPanama\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A")) -(1663 "\"AblewasIereIsawElba\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A")) -(1664 "\"12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "12" nil "12" ("12")) -(1665 "\"(((2+2)*-3)-7)\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-")) -(1666 "\"-12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "-12" nil "-12" ("-12")) -(1667 "\"12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "12" nil "12" ("12")) -(1668 "\"(((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-")) -(1669 "\"-12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "-12" nil "-12" ("-12")) -(1670 "\"xyz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y")) -(1671 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz")) -(1672 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y")) -(1673 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz")) -(1674 "\"foo\" =~ /(?f)(?o)(?&foo)/" "(?f)(?o)(?&foo)" nil nil nil nil "foo" nil nil nil) -(1675 "\"fof\" =~ /(?f)(?o)(?&foo)/" "(?f)(?o)(?&foo)" nil nil nil nil "fof" nil "fof" ("f" "o")) -(1676 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o")) -(1677 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o")) -(1678 "\"ofo\" =~ /(?2)(f)(o)/" "(?2)(f)(o)" nil nil nil nil "ofo" nil "ofo" ("f" "o")) -(1679 "\"ofo\" =~ /(?&foo)(f)(?o)/" "(?&foo)(f)(?o)" nil nil nil nil "ofo" nil "ofo" ("f" "o")) -(1680 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) -(1681 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) -(1682 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) -(1683 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) -(1684 "\"foofoo\" =~ /(foo)(? 1 )/" "(foo)(? 1 )" nil nil nil nil "foofoo" t nil nil) -(1685 "\"foofoo\" =~ /(?foo)(?& foo )/" "(?foo)(?& foo )" nil nil nil nil "foofoo" t nil nil) -(1686 "\"foofoo\" =~ /(foo)(? +(1636 "\"xyzxyz\" =~ /(?:(abc)|(xyz))(?1)/" "(?:(abc)|(xyz))(?1)" nil nil nil nil "xyzxyz" nil nil nil) +(1637 "\"abcabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "abcabc" nil "abcabc" ("abc")) +(1638 "\"xyzabc\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzabc" nil "xyzabc" (nil "xyz")) +(1639 "\"xyzxyz\" =~ /(?:(?abc)|(xyz))(?®One)/" "(?:(?abc)|(xyz))(?®One)" nil nil nil nil "xyzxyz" nil nil nil) +(1640 "\"XYabcdY\" =~ /^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/" "^X(?5)(a)(?:(b)|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1641 "\"XYabcdY\" =~ /^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)/" "^X(?®Five)(a)(?:(b)|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1642 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(r)(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1643 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)/" "^X(?®Seven)(a)(?:(b|(r)(s))|(q))(c)(?d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1644 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)/" "^X(?7)(a)(?:(b|(?:(r)|(t))(s))|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1645 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)/" "^X(?®Seven)(a)(?:(b|(?:(r)|(t))(s))|(q))(?c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1646 "\"abc\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "abc" nil "abc" ("c")) +(1647 "\"a(b)c\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c")) +(1648 "\"a(b(c))d\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d")) +(1649 "\"a(b(c)d\" =~ /^([^()]|\\((?1)*\\))*$/" "^([^()]|\\((?1)*\\))*$" nil nil nil nil "a(b(c)d" nil nil nil) +(1650 "\"abc\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "abc" nil "abc" ("c")) +(1651 "\"a(b)c\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b)c" nil "a(b)c" ("c")) +(1652 "\"a(b(c))d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c))d" nil "a(b(c))d" ("d")) +(1653 "\"a(b(c)d\" =~ /^(?[^()]|\\((?®One)*\\))*$/" "^(?[^()]|\\((?®One)*\\))*$" nil nil nil nil "a(b(c)d" nil nil nil) +(1654 "\">abc>123abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>123abc>123abc>1(2)3abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>([^()]|\\((?1)*\\))*abc>([^()]|\\((?1)*\\))*abc>(1(2)3)abc>(1(2)3)abc>123abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>123abc>123abc>1(2)3abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>1(2)3abc>1(2)3abc>(1(2)3)abc>(?[^()]|\\((?®One)*\\))*abc>(?[^()]|\\((?®One)*\\))*abc>(1(2)3)abc>(1(2)3)(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "1221" nil "1221" ("1221" "1")) +(1666 "\"Satanoscillatemymetallicsonatas\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Satanoscillatemymetallicsonatas" nil "Satanoscillatemymetallicsonatas" (nil nil "Satanoscillatemymetallicsonatas" "S")) +(1667 "\"AmanaplanacanalPanama\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AmanaplanacanalPanama" nil "AmanaplanacanalPanama" (nil nil "AmanaplanacanalPanama" "A")) +(1668 "\"AblewasIereIsawElba\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "AblewasIereIsawElba" nil "AblewasIereIsawElba" (nil nil "AblewasIereIsawElba" "A")) +(1669 "\"Thequickbrownfox\" =~ /^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$/i" "^(?:(?(.)(?®One)\\2|)|(?(.)(?®Three)\\4|.))$" t nil nil nil "Thequickbrownfox" nil nil nil) +(1670 "\"12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "12" nil "12" ("12")) +(1671 "\"(((2+2)*-3)-7)\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-")) +(1672 "\"-12\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "-12" nil "-12" ("-12")) +(1673 "\"((2+2)*-3)-7)\" =~ /^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$/" "^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$" nil nil nil nil "((2+2)*-3)-7)" nil nil nil) +(1674 "\"12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "12" nil "12" ("12")) +(1675 "\"(((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "(((2+2)*-3)-7)" nil "(((2+2)*-3)-7)" ("(((2+2)*-3)-7)" "-")) +(1676 "\"-12\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "-12" nil "-12" ("-12")) +(1677 "\"((2+2)*-3)-7)\" =~ /^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$/" "^(?\\d+|\\((?®One)([+*-])(?®One)\\)|-(?®One))$" nil nil nil nil "((2+2)*-3)-7)" nil nil nil) +(1678 "\"xyz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y")) +(1679 "\"xxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz")) +(1680 "\"xxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzz" nil nil nil) +(1681 "\"xxyzxyzxyzz\" =~ /^(x(y|(?1){2})z)/" "^(x(y|(?1){2})z)" nil nil nil nil "xxyzxyzxyzz" nil nil nil) +(1682 "\"xyz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xyz" nil "xyz" ("xyz" "y")) +(1683 "\"xxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzz" nil "xxyzxyzz" ("xxyzxyzz" "xyzxyz")) +(1684 "\"xxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzz" nil nil nil) +(1685 "\"xxyzxyzxyzz\" =~ /^(?x(y|(?®One){2})z)/" "^(?x(y|(?®One){2})z)" nil nil nil nil "xxyzxyzxyzz" nil nil nil) +(1686 "\"foo\" =~ /(?f)(?o)(?&foo)/" "(?f)(?o)(?&foo)" nil nil nil nil "foo" nil nil nil) +(1687 "\"fof\" =~ /(?f)(?o)(?&foo)/" "(?f)(?o)(?&foo)" nil nil nil nil "fof" nil "fof" ("f" "o")) +(1688 "\"ffo\" =~ /(?1)(f)(o)/" "(?1)(f)(o)" nil nil nil nil "ffo" nil "ffo" ("f" "o")) +(1689 "\"ffo\" =~ /(?&foo)(?f)(?o)/" "(?&foo)(?f)(?o)" nil nil nil nil "ffo" nil "ffo" ("f" "o")) +(1690 "\"ofo\" =~ /(?2)(f)(o)/" "(?2)(f)(o)" nil nil nil nil "ofo" nil "ofo" ("f" "o")) +(1691 "\"ofo\" =~ /(?&foo)(f)(?o)/" "(?&foo)(f)(?o)" nil nil nil nil "ofo" nil "ofo" ("f" "o")) +(1692 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) +(1693 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) +(1694 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) +(1695 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) +(1696 "\"foofoo\" =~ /(foo)(? 1 )/" "(foo)(? 1 )" nil nil nil nil "foofoo" t nil nil) +(1697 "\"foofoo\" =~ /(?foo)(?& foo )/" "(?foo)(?& foo )" nil nil nil nil "foofoo" t nil nil) +(1698 "\"foofoo\" =~ /(foo)(? 1)/" "(foo)(? 1)" nil nil nil nil "foofoo" t nil nil) -(1687 "\"foofoo\" =~ /(?foo)(?& +(1699 "\"foofoo\" =~ /(?foo)(?& foo)/" "(?foo)(?& foo)" nil nil nil nil "foofoo" t nil nil) -(1688 "\"foofoo\" =~ /(foo)(?1 +(1700 "\"foofoo\" =~ /(foo)(?1 )/" "(foo)(?1 )" nil nil nil nil "foofoo" t nil nil) -(1689 "\"foofoo\" =~ /(?foo)(?&foo +(1701 "\"foofoo\" =~ /(?foo)(?&foo )/" "(?foo)(?&foo )" nil nil nil nil "foofoo" t nil nil) -(1690 "\"0123456789foofoo\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)" nil nil nil nil "0123456789foofoo" nil "0123456789foofoo" ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "foo")) -(1691 "\"0123456789foofor\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)" nil nil nil nil "0123456789foofor" nil nil nil) -(1692 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "foo")) -(1693 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor" nil nil nil) +(1702 "\"0123456789foofoo\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)" nil nil nil nil "0123456789foofoo" nil "0123456789foofoo" ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "foo")) +(1703 "\"0123456789foofor\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)" nil nil nil nil "0123456789foofor" nil nil nil) +(1704 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "foo")) +(1705 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor" nil nil nil) diff --git a/test/perltestinput b/test/perltestinput index 0eddf99..62618b1 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -3966,10 +3966,12 @@ /(?:(abc)|(xyz))(?1)/ abcabc xyzabc + xyzxyz /(?:(?abc)|(xyz))(?®One)/ abcabc xyzabc + xyzxyz /^X(?5)(a)(?:(b)|(q))(c)(d)(Y)/ XYabcdY @@ -3993,11 +3995,13 @@ abc a(b)c a(b(c))d + a(b(c)d /^(?[^()]|\((?®One)*\))*$/ abc a(b)c a(b(c))d + a(b(c)d /^>abc>([^()]|\((?1)*\))*abc>123(.)(?®One)\2|)|(?(.)(?®Three)\4|.))$/i 1221 Satanoscillatemymetallicsonatas AmanaplanacanalPanama AblewasIereIsawElba + Thequickbrownfox /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ 12 (((2+2)*-3)-7) -12 + ((2+2)*-3)-7) /^(?\d+|\((?®One)([+*-])(?®One)\)|-(?®One))$/ 12 (((2+2)*-3)-7) -12 + ((2+2)*-3)-7) /^(x(y|(?1){2})z)/ xyz xxyzxyzz + xxyzz + xxyzxyzxyzz /^(?x(y|(?®One){2})z)/ xyz xxyzxyzz + xxyzz + xxyzxyzxyzz /(?f)(?o)(?&foo)/ foo From 41cbc8055775a5893d85979eb8d8175b5bc25309 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Wed, 15 Jan 2014 20:18:02 -0500 Subject: [PATCH 061/130] Add HAS-SUBPATTERN-REF-P function to convert.lisp. --- convert.lisp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/convert.lisp b/convert.lisp index 20b081c..3fbe51f 100644 --- a/convert.lisp +++ b/convert.lisp @@ -300,6 +300,12 @@ NIL or a STR object of the same case mode. Always returns NIL." (setq accumulate-start-p nil)))) nil) +(defun has-subpattern-ref-p (parse-tree) + (declare #.*standard-optimize-settings*) + (and (consp parse-tree) + (or (eql (car parse-tree) :subpattern-reference) + (some #'has-subpattern-ref-p (cdr parse-tree))))) + (declaim (inline convert-aux)) (defun convert-aux (parse-tree) "Converts the parse tree PARSE-TREE into a REGEX object and returns From 8cdc21b70a0523e72282ef82199ef7849e2ed39a Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Wed, 15 Jan 2014 20:32:53 -0500 Subject: [PATCH 062/130] Don't needlessly stop accumulating for string-beginning optimization. Specifically, once we see a register, continue building the constant string beginning unless the regex contains a subpattern reference. --- convert.lisp | 22 +++++++++++++--------- test/perltestdata | 1 + test/perltestinput | 3 +++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/convert.lisp b/convert.lisp index 3fbe51f..7fd551c 100644 --- a/convert.lisp +++ b/convert.lisp @@ -587,7 +587,7 @@ called with GREEDYP set to NIL as you would expect." "The case for \(:REGISTER ). Also used for named registers when NAME is not NIL." (declare #.*standard-optimize-settings*) - (declare (special flags reg-num reg-names accumulate-start-p)) + (declare (special flags reg-num reg-names has-subpattern-ref accumulate-start-p)) ;; keep the effect of modifiers local to the enclosed regex; also, ;; assign the current value of REG-NUM to the corresponding slot of ;; the REGISTER object and increase this counter afterwards; for @@ -599,16 +599,18 @@ when NAME is not NIL." (setq reg-seen t) (incf (the fixnum reg-num)) (push name reg-names) - ;; FIXME: While inside registers, we cannot indiscriminately accumulate into - ;; the special variable STARTS-WITH because recursive subpattern references + ;; While inside registers, we cannot indiscriminately accumulate into the + ;; special variable STARTS-WITH because recursive subpattern references ;; might cause too much of the string to be skipped or endless recursion, as ;; with: ;; (scan "(\\([^()]*(?:(?1)|\\))\\))" "(())") - ;; For now, we set ACCUMULATE-START-P to NIL, but it may be possible to - ;; determine which registers are referenced--either now or at the matcher - ;; generation phase--and not needlessly throw away information that may be - ;; helpful in optimization. - (setq accumulate-start-p nil) + ;; For now, we set ACCUMULATE-START-P to NIL if the regex has one or more + ;; subpattern references, but it may be possible to determine which + ;; registers are referenced--either now or at the matcher generation + ;; phase--and not needlessly throw away information that may be helpful in + ;; optimization. + (when has-subpattern-ref + (setq accumulate-start-p nil)) (make-instance 'register :regex (convert-aux (if name (third parse-tree) (second parse-tree))) :num stored-reg-num @@ -948,6 +950,7 @@ by subpattern references in the REGEX." starts-with (max-back-ref 0) (max-subpattern-ref 0) + (has-subpattern-ref (has-subpattern-ref-p parse-tree)) (converted-parse-tree (convert-aux parse-tree))) (declare (special flags reg-num reg-names @@ -956,7 +959,8 @@ by subpattern references in the REGEX." max-back-ref max-subpattern-ref numbered-subpattern-refs - named-subpattern-refs)) + named-subpattern-refs + has-subpattern-ref)) ;; make sure we don't reference registers which aren't there (when (> (the fixnum max-back-ref) (the fixnum reg-num)) diff --git a/test/perltestdata b/test/perltestdata index aac1b03..9aa478d 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14374,3 +14374,4 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1703 "\"0123456789foofor\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?11)" nil nil nil nil "0123456789foofor" nil nil nil) (1704 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "foo")) (1705 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor" nil nil nil) +(1706 "\"(())\" =~ /(\\([^()]*(?:(?1)|\\))\\))/" "(\\([^()]*(?:(?1)|\\))\\))" nil nil nil nil "(())" nil "())" ("())")) diff --git a/test/perltestinput b/test/perltestinput index 62618b1..5439cf6 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4108,3 +4108,6 @@ foo)/ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/ 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor + +/(\([^()]*(?:(?1)|\))\))/ + (()) \ No newline at end of file From 7c501f0095d8fdd7b54b62eb53c8d54b58e5e034 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 16 Jan 2014 17:53:43 -0500 Subject: [PATCH 063/130] Remove specific test references from comment. The test numbers are no longer correct and are subject to change further. --- closures.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/closures.lisp b/closures.lisp index 22505a1..78b244d 100644 --- a/closures.lisp +++ b/closures.lisp @@ -124,7 +124,7 @@ such that the call to NEXT-FN after the match would succeed.")) (let ((next-pos ;; Create a new temporary set of registers for matching ;; back references while inside a subpattern reference, as - ;; with Perl. Cf. tests 1643-1646. + ;; with Perl. (let* ((reg-num (array-dimension *reg-starts* 0)) (*reg-starts* (make-array reg-num :initial-element nil)) (*regs-maybe-start* (make-array reg-num :initial-element nil)) From e4dfb257535e759d020d2da47d135378cbde50ca Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 16 Jan 2014 17:56:27 -0500 Subject: [PATCH 064/130] Fix indentation. --- closures.lisp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/closures.lisp b/closures.lisp index 78b244d..825e492 100644 --- a/closures.lisp +++ b/closures.lisp @@ -95,11 +95,11 @@ such that the call to NEXT-FN after the match would succeed.")) ;; update the corresponding values of *REGS-START* and *REGS-END* ;; after the inner matcher has succeeded (flet ((store-end-of-reg (start-pos) - (declare (fixnum start-pos) - (function next-fn)) - (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) - (svref *reg-ends* num) start-pos) - (funcall next-fn start-pos))) + (declare (fixnum start-pos) + (function next-fn)) + (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) + (svref *reg-ends* num) start-pos) + (funcall next-fn start-pos))) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER (let ((inner-matcher (create-matcher-aux (regex register) From 49878b0841634a018923bd7b677c15a46d5f47b9 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 16 Jan 2014 18:41:48 -0500 Subject: [PATCH 065/130] Don't create a separate matcher for matching registers from subpattern references. Instead, every time we descend into a register from a subpattern reference, we first push a value onto a register-specific list and pop it off once we return. When STORE-END-OF-REG sees that there is a value on the list, it knows we entered the register from a subpattern reference and doesn't try to match the part of the regex following the register. It's hard to say whether this improves or degrades performance and readability. But it does seem simpler. --- closures.lisp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/closures.lisp b/closures.lisp index 825e492..677593f 100644 --- a/closures.lisp +++ b/closures.lisp @@ -89,29 +89,26 @@ such that the call to NEXT-FN after the match would succeed.")) (declare (special referenced-register-matchers subpattern-refs)) ;; the position of this REGISTER within the whole regex; we start to ;; count at 0 - (let ((num (num register))) - (declare (fixnum num)) + (let ((num (num register)) + here-from-subpattern-ref) + (declare (fixnum num) + (list here-from-subpattern-ref)) ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which will ;; update the corresponding values of *REGS-START* and *REGS-END* ;; after the inner matcher has succeeded (flet ((store-end-of-reg (start-pos) (declare (fixnum start-pos) (function next-fn)) - (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) - (svref *reg-ends* num) start-pos) - (funcall next-fn start-pos))) + (if here-from-subpattern-ref + start-pos + (progn + (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) + (svref *reg-ends* num) start-pos) + (funcall next-fn start-pos))))) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER (let ((inner-matcher (create-matcher-aux (regex register) - #'store-end-of-reg)) - ;; When this register is reached directly through a subpattern - ;; reference, don't pass control to NEXT-FN. - (inner-matcher-subpattern-ref (and (member (the fixnum (1+ num)) - (the list subpattern-refs) - :test #'=) - (create-matcher-aux - (regex register) - #'identity)))) + #'store-end-of-reg))) (declare (function inner-matcher)) ;; here comes the actual closure for REGISTER (setf (getf (car referenced-register-matchers) num) @@ -130,7 +127,14 @@ such that the call to NEXT-FN after the match would succeed.")) (*regs-maybe-start* (make-array reg-num :initial-element nil)) (*reg-ends* (make-array reg-num :initial-element nil))) (setf (svref *regs-maybe-start* num) start-pos) - (funcall (the function inner-matcher-subpattern-ref) start-pos)))) + ;; Push T onto HERE-FROM-SUBPATTERN-REF and pop it back + ;; off after we have passed through the register closure. + ;; We can't use a special variable instead, since it + ;; would be shared by all the registers. + (push t here-from-subpattern-ref) + (prog1 + (funcall inner-matcher start-pos) + (pop here-from-subpattern-ref))))) (when next-pos (funcall (the function other-fn) next-pos)))) (t From da8f47467600567b8f291db3905b3f823e461fdf Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 16 Jan 2014 19:00:05 -0500 Subject: [PATCH 066/130] Use IF instead of COND for simple condition. --- closures.lisp | 74 ++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/closures.lisp b/closures.lisp index 677593f..a16fda1 100644 --- a/closures.lisp +++ b/closures.lisp @@ -114,45 +114,41 @@ such that the call to NEXT-FN after the match would succeed.")) (setf (getf (car referenced-register-matchers) num) (lambda (start-pos &optional other-fn) (declare (fixnum start-pos)) - (cond - (other-fn - ;; The presence of OTHER-FN indicates we have been called by a - ;; subpattern reference closure. - (let ((next-pos - ;; Create a new temporary set of registers for matching - ;; back references while inside a subpattern reference, as - ;; with Perl. - (let* ((reg-num (array-dimension *reg-starts* 0)) - (*reg-starts* (make-array reg-num :initial-element nil)) - (*regs-maybe-start* (make-array reg-num :initial-element nil)) - (*reg-ends* (make-array reg-num :initial-element nil))) - (setf (svref *regs-maybe-start* num) start-pos) - ;; Push T onto HERE-FROM-SUBPATTERN-REF and pop it back - ;; off after we have passed through the register closure. - ;; We can't use a special variable instead, since it - ;; would be shared by all the registers. - (push t here-from-subpattern-ref) - (prog1 - (funcall inner-matcher start-pos) - (pop here-from-subpattern-ref))))) - (when next-pos - (funcall (the function other-fn) next-pos)))) - (t - ;; remember the old values of *REGS-START* and friends in - ;; case we cannot match - (let ((old-*reg-starts* (svref *reg-starts* num)) - (old-*regs-maybe-start* (svref *regs-maybe-start* num)) - (old-*reg-ends* (svref *reg-ends* num))) - ;; we cannot use *REGS-START* here because Perl allows - ;; regular expressions like /(a|\1x)*/ - (setf (svref *regs-maybe-start* num) start-pos) - (let ((next-pos (funcall inner-matcher start-pos))) - (unless next-pos - ;; restore old values on failure - (setf (svref *reg-starts* num) old-*reg-starts* - (svref *regs-maybe-start* num) old-*regs-maybe-start* - (svref *reg-ends* num) old-*reg-ends*)) - next-pos)))))))))) + (if other-fn + ;; The presence of OTHER-FN indicates we have been called by a + ;; subpattern reference closure. + (let ((next-pos + ;; Create a new temporary set of registers for matching + ;; back references while inside a subpattern reference, as + ;; with Perl. + (let* ((reg-num (array-dimension *reg-starts* 0)) + (*reg-starts* (make-array reg-num :initial-element nil)) + (*regs-maybe-start* (make-array reg-num :initial-element nil)) + (*reg-ends* (make-array reg-num :initial-element nil))) + (setf (svref *regs-maybe-start* num) start-pos) + ;; Push T onto HERE-FROM-SUBPATTERN-REF and pop it back + ;; off after we have passed through the register + ;; closure. Using a special variable instead wouldn't + ;; work, since it would be shared by all the registers. + (push t here-from-subpattern-ref) + (prog1 + (funcall inner-matcher start-pos) + (pop here-from-subpattern-ref))))) + (when next-pos + (funcall (the function other-fn) next-pos))) + (let ((old-*reg-starts* (svref *reg-starts* num)) + (old-*regs-maybe-start* (svref *regs-maybe-start* num)) + (old-*reg-ends* (svref *reg-ends* num))) + ;; we cannot use *REGS-START* here because Perl allows regular + ;; expressions like /(a|\1x)*/ + (setf (svref *regs-maybe-start* num) start-pos) + (let ((next-pos (funcall inner-matcher start-pos))) + (unless next-pos + ;; restore old values on failure + (setf (svref *reg-starts* num) old-*reg-starts* + (svref *regs-maybe-start* num) old-*regs-maybe-start* + (svref *reg-ends* num) old-*reg-ends*)) + next-pos))))))))) (defmethod create-matcher-aux ((lookahead lookahead) next-fn) (declare #.*standard-optimize-settings*) From 2805231fd37f1fc2a9b713432e82e3dd73650de7 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 16 Jan 2014 19:00:28 -0500 Subject: [PATCH 067/130] Add some more tests that check for correct backtracking through subpattern references. These currently fail. --- test/perltestdata | 12 ++++++++++++ test/perltestinput | 22 +++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/test/perltestdata b/test/perltestdata index 9aa478d..c4be27a 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14375,3 +14375,15 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1704 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofoo" ("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "foo")) (1705 "\"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor\" =~ /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)/" "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(foo)(?131)" nil nil nil nil "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor" nil nil nil) (1706 "\"(())\" =~ /(\\([^()]*(?:(?1)|\\))\\))/" "(\\([^()]*(?:(?1)|\\))\\))" nil nil nil nil "(())" nil "())" ("())")) +(1707 "\"o\" =~ /(o(?1)?)(?1)/" "(o(?1)?)(?1)" nil nil nil nil "o" nil nil nil) +(1708 "\"oo\" =~ /(o(?1)?)(?1)/" "(o(?1)?)(?1)" nil nil nil nil "oo" nil "oo" ("o")) +(1709 "\"ooo\" =~ /(o(?1)?)(?1)/" "(o(?1)?)(?1)" nil nil nil nil "ooo" nil "ooo" ("oo")) +(1710 "\"o\" =~ /(?o(?®One)?)(?®One)/" "(?o(?®One)?)(?®One)" nil nil nil nil "o" nil nil nil) +(1711 "\"oo\" =~ /(?o(?®One)?)(?®One)/" "(?o(?®One)?)(?®One)" nil nil nil nil "oo" nil "oo" ("o")) +(1712 "\"ooo\" =~ /(?o(?®One)?)(?®One)/" "(?o(?®One)?)(?®One)" nil nil nil nil "ooo" nil "ooo" ("oo")) +(1713 "\"o\" =~ /(?1)(o(?1)?)/" "(?1)(o(?1)?)" nil nil nil nil "o" nil nil nil) +(1714 "\"oo\" =~ /(?1)(o(?1)?)/" "(?1)(o(?1)?)" nil nil nil nil "oo" nil "oo" ("o")) +(1715 "\"ooo\" =~ /(?1)(o(?1)?)/" "(?1)(o(?1)?)" nil nil nil nil "ooo" nil "ooo" ("o")) +(1716 "\"o\" =~ /(?®One)(?o(?®One)?)/" "(?®One)(?o(?®One)?)" nil nil nil nil "o" nil nil nil) +(1717 "\"oo\" =~ /(?®One)(?o(?®One)?)/" "(?®One)(?o(?®One)?)" nil nil nil nil "oo" nil "oo" ("o")) +(1718 "\"ooo\" =~ /(?®One)(?o(?®One)?)/" "(?®One)(?o(?®One)?)" nil nil nil nil "ooo" nil "ooo" ("o")) diff --git a/test/perltestinput b/test/perltestinput index 5439cf6..9266f95 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4110,4 +4110,24 @@ foo)/ 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789foofor /(\([^()]*(?:(?1)|\))\))/ - (()) \ No newline at end of file + (()) + +/(o(?1)?)(?1)/ + o + oo + ooo + +/(?o(?®One)?)(?®One)/ + o + oo + ooo + +/(?1)(o(?1)?)/ + o + oo + ooo + +/(?®One)(?o(?®One)?)/ + o + oo + ooo From 5c0f673351335d879f0acfc68e55bdd50ab11c8f Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 19 Jan 2014 15:04:17 -0500 Subject: [PATCH 068/130] Backtrack correctly into subpattern references. This enables correct matching for calls such as: (ppcre:scan "(?1)(o(?1)?)" "oo") --- closures.lisp | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/closures.lisp b/closures.lisp index a16fda1..cbf62cb 100644 --- a/closures.lisp +++ b/closures.lisp @@ -100,7 +100,14 @@ such that the call to NEXT-FN after the match would succeed.")) (declare (fixnum start-pos) (function next-fn)) (if here-from-subpattern-ref - start-pos + (let* ((*reg-starts* (second (car here-from-subpattern-ref))) + (*regs-maybe-start* (third (car here-from-subpattern-ref))) + (*reg-ends* (fourth (car here-from-subpattern-ref))) + (next-fn (first (car here-from-subpattern-ref))) + (regs (pop here-from-subpattern-ref))) + (prog1 + (funcall (the function next-fn) start-pos) + (push regs here-from-subpattern-ref))) (progn (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) (svref *reg-ends* num) start-pos) @@ -117,25 +124,23 @@ such that the call to NEXT-FN after the match would succeed.")) (if other-fn ;; The presence of OTHER-FN indicates we have been called by a ;; subpattern reference closure. - (let ((next-pos - ;; Create a new temporary set of registers for matching - ;; back references while inside a subpattern reference, as - ;; with Perl. - (let* ((reg-num (array-dimension *reg-starts* 0)) - (*reg-starts* (make-array reg-num :initial-element nil)) - (*regs-maybe-start* (make-array reg-num :initial-element nil)) - (*reg-ends* (make-array reg-num :initial-element nil))) - (setf (svref *regs-maybe-start* num) start-pos) - ;; Push T onto HERE-FROM-SUBPATTERN-REF and pop it back - ;; off after we have passed through the register - ;; closure. Using a special variable instead wouldn't - ;; work, since it would be shared by all the registers. - (push t here-from-subpattern-ref) - (prog1 - (funcall inner-matcher start-pos) - (pop here-from-subpattern-ref))))) - (when next-pos - (funcall (the function other-fn) next-pos))) + (progn + ;; Create a new temporary set of registers for matching back + ;; references while inside a subpattern reference, as with + ;; Perl. Save the old ones. + (push (list other-fn *reg-starts* *regs-maybe-start* *reg-ends*) + here-from-subpattern-ref) + (let ((reg-num (array-dimension *reg-starts* 0))) + (setf *reg-starts* (make-array reg-num :initial-element nil) + *regs-maybe-start* (make-array reg-num :initial-element nil) + *reg-ends* (make-array reg-num :initial-element nil)) + (setf (svref *regs-maybe-start* num) start-pos)) + (prog1 + (funcall inner-matcher start-pos) + (setf *reg-starts* (second (car here-from-subpattern-ref)) + *regs-maybe-start* (third (car here-from-subpattern-ref)) + *reg-ends* (fourth (car here-from-subpattern-ref))) + (pop here-from-subpattern-ref))) (let ((old-*reg-starts* (svref *reg-starts* num)) (old-*regs-maybe-start* (svref *regs-maybe-start* num)) (old-*reg-ends* (svref *reg-ends* num))) From 987c5b4c798d53b2ff39153c1e2a8d393c6450fc Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 19 Jan 2014 16:14:20 -0500 Subject: [PATCH 069/130] Clean up CREATE-MATCHER-AUX method for REGISTER. Add some comments, and rename a variable. --- closures.lisp | 52 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/closures.lisp b/closures.lisp index cbf62cb..5492a67 100644 --- a/closures.lisp +++ b/closures.lisp @@ -90,24 +90,35 @@ such that the call to NEXT-FN after the match would succeed.")) ;; the position of this REGISTER within the whole regex; we start to ;; count at 0 (let ((num (num register)) - here-from-subpattern-ref) + saved-regs) (declare (fixnum num) - (list here-from-subpattern-ref)) + (list saved-regs)) ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which will ;; update the corresponding values of *REGS-START* and *REGS-END* ;; after the inner matcher has succeeded (flet ((store-end-of-reg (start-pos) (declare (fixnum start-pos) (function next-fn)) - (if here-from-subpattern-ref - (let* ((*reg-starts* (second (car here-from-subpattern-ref))) - (*regs-maybe-start* (third (car here-from-subpattern-ref))) - (*reg-ends* (fourth (car here-from-subpattern-ref))) - (next-fn (first (car here-from-subpattern-ref))) - (regs (pop here-from-subpattern-ref))) + (if saved-regs + ;; this register was entered through a subpattern reference; + ;; restore the old register arrays, and attempt to match the + ;; rest of the pattern + (let* ((*reg-starts* (second (car saved-regs))) + (*regs-maybe-start* (third (car saved-regs))) + (*reg-ends* (fourth (car saved-regs))) + (next-fn (first (car saved-regs))) + ;; pop the saved register arrays off in case we come + ;; into this register again while matching the rest of + ;; the pattern + (regs (pop saved-regs))) (prog1 (funcall (the function next-fn) start-pos) - (push regs here-from-subpattern-ref))) + ;; push the saved register arrays back on so they can be + ;; restored when the stack is unwound; + (push regs saved-regs))) + ;; this register was not entered through a subpattern + ;; reference; save the start and end positions, and match the + ;; rest of the pattern (progn (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) (svref *reg-ends* num) start-pos) @@ -117,30 +128,33 @@ such that the call to NEXT-FN after the match would succeed.")) (let ((inner-matcher (create-matcher-aux (regex register) #'store-end-of-reg))) (declare (function inner-matcher)) - ;; here comes the actual closure for REGISTER + ;; here comes the actual closure for REGISTER; save it is a special + ;; variable so it can be called by subpattern references (setf (getf (car referenced-register-matchers) num) (lambda (start-pos &optional other-fn) (declare (fixnum start-pos)) (if other-fn - ;; The presence of OTHER-FN indicates we have been called by a - ;; subpattern reference closure. + ;; the presence of OTHER-FN indicates that this register has been + ;; entered by a subpattern reference closure; (progn - ;; Create a new temporary set of registers for matching back + ;; create a new temporary set of registers for matching back ;; references while inside a subpattern reference, as with - ;; Perl. Save the old ones. + ;; Perl; save the old ones (push (list other-fn *reg-starts* *regs-maybe-start* *reg-ends*) - here-from-subpattern-ref) + saved-regs) (let ((reg-num (array-dimension *reg-starts* 0))) (setf *reg-starts* (make-array reg-num :initial-element nil) *regs-maybe-start* (make-array reg-num :initial-element nil) *reg-ends* (make-array reg-num :initial-element nil)) (setf (svref *regs-maybe-start* num) start-pos)) (prog1 + ;; match the inner regex and the rest of the pattern; + ;; restore the original set of registers before returning (funcall inner-matcher start-pos) - (setf *reg-starts* (second (car here-from-subpattern-ref)) - *regs-maybe-start* (third (car here-from-subpattern-ref)) - *reg-ends* (fourth (car here-from-subpattern-ref))) - (pop here-from-subpattern-ref))) + (setf *reg-starts* (second (car saved-regs)) + *regs-maybe-start* (third (car saved-regs)) + *reg-ends* (fourth (car saved-regs))) + (pop saved-regs))) (let ((old-*reg-starts* (svref *reg-starts* num)) (old-*regs-maybe-start* (svref *regs-maybe-start* num)) (old-*reg-ends* (svref *reg-ends* num))) From bab5e70b9baab0ed96a4d24aed46cbf9e0e07da4 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 19 Jan 2014 18:57:35 -0500 Subject: [PATCH 070/130] Clarify and remove some comments. --- optimize.lisp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/optimize.lisp b/optimize.lisp index bd0e375..ef9b951 100644 --- a/optimize.lisp +++ b/optimize.lisp @@ -381,9 +381,10 @@ function called by END-STRING.)")) (eq (case-insensitive-p str) old-case-insensitive-p))) ;; set the SKIP property of this STR (setf last-str str) - ;; FIXME: Only apply this optimization when we don't have subpattern - ;; references. This may still be possible if we know about the context - ;; of this string, such as which register(s) it falls within. + ;; only apply the "skip" optimization when there are no subpattern + ;; references: otherwise we may skip thinking we're at the end of the + ;; string when in fact we're just inside a forward subpattern + ;; reference; we could do better here, but it's probably not worth it (when (null subpattern-refs) (setf (skip str) t)) str) @@ -491,8 +492,6 @@ function called by END-STRING.)")) (t ;; (ALTERNATION, BACK-REFERENCE, BRANCH, CHAR-CLASS, EVERYTHING, ;; REPETITION, FILTER, SUBPATTERN-REFERENCE) - ;; FIXME: Can we determine constant string ending in the case of - ;; SUBPATTERN-REFERENCE? nil))) (defun end-string (regex) @@ -508,8 +507,9 @@ into a STR object, otherwise NIL." (declare (special continuep last-str)) (prog1 (end-string-aux regex) - ;; Don't set START-OF-END-STRING-P when subpattern references are present. - ;; FIXME: This may still be doable and preferable. + ;; don't set START-OF-END-STRING-P when subpattern references are present: + ;; otherwise we may think we're at the end of a string when we're actually + ;; in a forward subpattern reference. (when (and last-str (null subpattern-refs)) ;; if we've found something set the START-OF-END-STRING-P of ;; the leftmost STR collected accordingly and remember the From e32cf5144e072a3499b9d35efb08f72846833449 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 20 Jan 2014 14:16:52 -0500 Subject: [PATCH 071/130] Add some more subpattern reference tests. These were taken from PCRE's file testdata/testinput2 with slight modifications. --- test/perltestdata | 36 +++++++++++++++++++++++ test/perltestinput | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index c4be27a..07981ec 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14387,3 +14387,39 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1716 "\"o\" =~ /(?®One)(?o(?®One)?)/" "(?®One)(?o(?®One)?)" nil nil nil nil "o" nil nil nil) (1717 "\"oo\" =~ /(?®One)(?o(?®One)?)/" "(?®One)(?o(?®One)?)" nil nil nil nil "oo" nil "oo" ("o")) (1718 "\"ooo\" =~ /(?®One)(?o(?®One)?)/" "(?®One)(?o(?®One)?)" nil nil nil nil "ooo" nil "ooo" ("o")) +(1719 "\"1221\" =~ /^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$/i" "^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$" t nil nil nil "1221" nil "1221" ("1221" "1")) +(1720 "\"Satan, oscillate my metallic sonatas!\" =~ /^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$/i" "^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$" t nil nil nil "Satan, oscillate my metallic sonatas!" nil "Satan, oscillate my metallic sonatas!" (nil nil "Satan, oscillate my metallic sonatas" "S")) +(1721 "\"A man, a plan, a canal: Panama!\" =~ /^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$/i" "^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$" t nil nil nil "A man, a plan, a canal: Panama!" nil "A man, a plan, a canal: Panama!" (nil nil "A man, a plan, a canal: Panama" "A")) +(1722 "\"Able was I ere I saw Elba.\" =~ /^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$/i" "^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$" t nil nil nil "Able was I ere I saw Elba." nil "Able was I ere I saw Elba." (nil nil "Able was I ere I saw Elba" "A")) +(1723 "\"The quick brown fox\" =~ /^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$/i" "^\\W*(?:((.)\\W*(?1)\\W*\\2|)|((.)\\W*(?3)\\W*\\4|\\W*.\\W*))\\W*$" t nil nil nil "The quick brown fox" nil nil nil) +(1724 "\"1221\" =~ /^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$/i" "^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$" t nil nil nil "1221" nil "1221" ("1221" "1")) +(1725 "\"Satan, oscillate my metallic sonatas!\" =~ /^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$/i" "^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$" t nil nil nil "Satan, oscillate my metallic sonatas!" nil "Satan, oscillate my metallic sonatas!" (nil nil "Satan, oscillate my metallic sonatas" "S")) +(1726 "\"A man, a plan, a canal: Panama!\" =~ /^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$/i" "^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$" t nil nil nil "A man, a plan, a canal: Panama!" nil "A man, a plan, a canal: Panama!" (nil nil "A man, a plan, a canal: Panama" "A")) +(1727 "\"Able was I ere I saw Elba.\" =~ /^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$/i" "^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$" t nil nil nil "Able was I ere I saw Elba." nil "Able was I ere I saw Elba." (nil nil "Able was I ere I saw Elba" "A")) +(1728 "\"The quick brown fox\" =~ /^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$/i" "^\\W*(?:(?(?.)\\W*(?&one)\\W*\\k|)|(?(?.)\\W*(?&three)\\W*\\k|\\W*.\\W*))\\W*$" t nil nil nil "The quick brown fox" nil nil nil) +(1729 "\"bdaa\" =~ /(a|b)(d|e)(?1){2}/" "(a|b)(d|e)(?1){2}" nil nil nil nil "bdaa" nil "bdaa" ("b" "d")) +(1730 "\"bdab\" =~ /(a|b)(d|e)(?1){2}/" "(a|b)(d|e)(?1){2}" nil nil nil nil "bdab" nil "bdab" ("b" "d")) +(1731 "\"bddd\" =~ /(a|b)(d|e)(?1){2}/" "(a|b)(d|e)(?1){2}" nil nil nil nil "bddd" nil nil nil) +(1732 "\"bdaa\" =~ /(?a|b)(?d|e)(?&abc){2}/" "(?a|b)(?d|e)(?&abc){2}" nil nil nil nil "bdaa" nil "bdaa" ("b" "d")) +(1733 "\"bdab\" =~ /(?a|b)(?d|e)(?&abc){2}/" "(?a|b)(?d|e)(?&abc){2}" nil nil nil nil "bdab" nil "bdab" ("b" "d")) +(1734 "\"bddd\" =~ /(?a|b)(?d|e)(?&abc){2}/" "(?a|b)(?d|e)(?&abc){2}" nil nil nil nil "bddd" nil nil nil) +(1735 "\"abcPXP123\" =~ /(?1)X(P)/i" "(?1)X(P)" t nil nil nil "abcPXP123" nil "PXP" ("P")) +(1736 "\"abcPXP123\" =~ /(?&abc)X(?P)/i" "(?&abc)X(?P)" t nil nil nil "abcPXP123" nil "PXP" ("P")) +(1737 "\"123axbaxbaxbx456\" =~ /(?:a(?1)b)*(x)/" "(?:a(?1)b)*(x)" nil nil nil nil "123axbaxbaxbx456" nil "axbaxbaxbx" ("x")) +(1738 "\"123axbaxbaxb456\" =~ /(?:a(?1)b)*(x)/" "(?:a(?1)b)*(x)" nil nil nil nil "123axbaxbaxb456" nil "x" ("x")) +(1739 "\"123axbaxbaxbx456\" =~ /(?:a(?&abc)b)*(?x)/" "(?:a(?&abc)b)*(?x)" nil nil nil nil "123axbaxbaxbx456" nil "axbaxbaxbx" ("x")) +(1740 "\"123axbaxbaxb456\" =~ /(?:a(?&abc)b)*(?x)/" "(?:a(?&abc)b)*(?x)" nil nil nil nil "123axbaxbaxb456" nil "x" ("x")) +(1741 "\"123axbaxbaxbx456\" =~ /(?:a(?1)b){1,5}(x)/" "(?:a(?1)b){1,5}(x)" nil nil nil nil "123axbaxbaxbx456" nil "axbaxbaxbx" ("x")) +(1742 "\"123axbaxbaxbx456\" =~ /(?:a(?&abc)b){1,5}(?x)/" "(?:a(?&abc)b){1,5}(?x)" nil nil nil nil "123axbaxbaxbx456" nil "axbaxbaxbx" ("x")) +(1743 "\"123axbaxbaxbx456\" =~ /(?:a(?1)b){2,5}(x)/" "(?:a(?1)b){2,5}(x)" nil nil nil nil "123axbaxbaxbx456" nil "axbaxbaxbx" ("x")) +(1744 "\"123axbaxbaxbx456\" =~ /(?:a(?&abc)b){2,5}(?x)/" "(?:a(?&abc)b){2,5}(?x)" nil nil nil nil "123axbaxbaxbx456" nil "axbaxbaxbx" ("x")) +(1745 "\"123axbaxbaxbx456\" =~ /(?:a(?1)b){2,}(x)/" "(?:a(?1)b){2,}(x)" nil nil nil nil "123axbaxbaxbx456" nil "axbaxbaxbx" ("x")) +(1746 "\"123axbaxbaxbx456\" =~ /(?:a(?&abc)b){2,}(?x)/" "(?:a(?&abc)b){2,}(?x)" nil nil nil nil "123axbaxbaxbx456" nil "axbaxbaxbx" ("x")) +(1747 "\"defabcabcxyz\" =~ /(abc)(?i:(?1))/" "(abc)(?i:(?1))" nil nil nil nil "defabcabcxyz" nil "abcabc" ("abc")) +(1748 "\"DEFabcABCXYZ\" =~ /(abc)(?i:(?1))/" "(abc)(?i:(?1))" nil nil nil nil "DEFabcABCXYZ" nil nil nil) +(1749 "\"defabcabcxyz\" =~ /(?abc)(?i:(?®One))/" "(?abc)(?i:(?®One))" nil nil nil nil "defabcabcxyz" nil "abcabc" ("abc")) +(1750 "\"DEFabcABCXYZ\" =~ /(?abc)(?i:(?®One))/" "(?abc)(?i:(?®One))" nil nil nil nil "DEFabcABCXYZ" nil nil nil) +(1751 "\"defabcabcxyz\" =~ /(abc)(?:(?i)(?1))/" "(abc)(?:(?i)(?1))" nil nil nil nil "defabcabcxyz" nil "abcabc" ("abc")) +(1752 "\"DEFabcABCXYZ\" =~ /(abc)(?:(?i)(?1))/" "(abc)(?:(?i)(?1))" nil nil nil nil "DEFabcABCXYZ" nil nil nil) +(1753 "\"defabcabcxyz\" =~ /(?abc)(?:(?i)(?®One))/" "(?abc)(?:(?i)(?®One))" nil nil nil nil "defabcabcxyz" nil "abcabc" ("abc")) +(1754 "\"DEFabcABCXYZ\" =~ /(?abc)(?:(?i)(?®One))/" "(?abc)(?:(?i)(?®One))" nil nil nil nil "DEFabcABCXYZ" nil nil nil) diff --git a/test/perltestinput b/test/perltestinput index 9266f95..a2758f5 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4131,3 +4131,75 @@ foo)/ o oo ooo + +/^\W*(?:((.)\W*(?1)\W*\2|)|((.)\W*(?3)\W*\4|\W*.\W*))\W*$/i + 1221 + Satan, oscillate my metallic sonatas! + A man, a plan, a canal: Panama! + Able was I ere I saw Elba. + The quick brown fox + +/^\W*(?:(?(?.)\W*(?&one)\W*\k|)|(?(?.)\W*(?&three)\W*\k|\W*.\W*))\W*$/i + 1221 + Satan, oscillate my metallic sonatas! + A man, a plan, a canal: Panama! + Able was I ere I saw Elba. + The quick brown fox + +/(a|b)(d|e)(?1){2}/ + bdaa + bdab + bddd + +/(?a|b)(?d|e)(?&abc){2}/ + bdaa + bdab + bddd + +/(?1)X(P)/i + abcPXP123 + +/(?&abc)X(?P)/i + abcPXP123 + +/(?:a(?1)b)*(x)/ + 123axbaxbaxbx456 + 123axbaxbaxb456 + +/(?:a(?&abc)b)*(?x)/ + 123axbaxbaxbx456 + 123axbaxbaxb456 + +/(?:a(?1)b){1,5}(x)/ + 123axbaxbaxbx456 + +/(?:a(?&abc)b){1,5}(?x)/ + 123axbaxbaxbx456 + +/(?:a(?1)b){2,5}(x)/ + 123axbaxbaxbx456 + +/(?:a(?&abc)b){2,5}(?x)/ + 123axbaxbaxbx456 + +/(?:a(?1)b){2,}(x)/ + 123axbaxbaxbx456 + +/(?:a(?&abc)b){2,}(?x)/ + 123axbaxbaxbx456 + +/(abc)(?i:(?1))/ + defabcabcxyz + DEFabcABCXYZ + +/(?abc)(?i:(?®One))/ + defabcabcxyz + DEFabcABCXYZ + +/(abc)(?:(?i)(?1))/ + defabcabcxyz + DEFabcABCXYZ + +/(?abc)(?:(?i)(?®One))/ + defabcabcxyz + DEFabcABCXYZ From 6f0ad138e2084eb2eb4ffd7bbf83abdff9c3e262 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 24 Jan 2014 18:19:45 -0500 Subject: [PATCH 072/130] Add more tests for subpattern references. These tests were taken from PCRE's testdata/testinput2 with slight modifications. --- test/perltestdata | 18 ++++++++++++++++++ test/perltestinput | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index 07981ec..a106f39 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14423,3 +14423,21 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1752 "\"DEFabcABCXYZ\" =~ /(abc)(?:(?i)(?1))/" "(abc)(?:(?i)(?1))" nil nil nil nil "DEFabcABCXYZ" nil nil nil) (1753 "\"defabcabcxyz\" =~ /(?abc)(?:(?i)(?®One))/" "(?abc)(?:(?i)(?®One))" nil nil nil nil "defabcabcxyz" nil "abcabc" ("abc")) (1754 "\"DEFabcABCXYZ\" =~ /(?abc)(?:(?i)(?®One))/" "(?abc)(?:(?i)(?®One))" nil nil nil nil "DEFabcABCXYZ" nil nil nil) +(1755 "\"abcbabc\" =~ /(?2)[]a()b](abc)/" "(?2)[]a()b](abc)" nil nil nil nil "abcbabc" t nil nil) +(1756 "\"abcbabc\" =~ /(?®Two)[]a()b](?)/" "(?®Two)[]a()b](?)" nil nil nil nil "abcbabc" nil "a" ("")) +(1757 "\"abcbabc\" =~ /(?2)[^]a()b](abc)/" "(?2)[^]a()b](abc)" nil nil nil nil "abcbabc" t nil nil) +(1758 "\"abcbabc\" =~ /(?®Two)[^]a()b](?abc)/" "(?®Two)[^]a()b](?abc)" nil nil nil nil "abcbabc" nil nil nil) +(1759 "\"abcbabc\" =~ /(?1)[]a()b](abc)/" "(?1)[]a()b](abc)" nil nil nil nil "abcbabc" nil "abcbabc" ("abc")) +(1760 "\"abcXabc\" =~ /(?1)[]a()b](abc)/" "(?1)[]a()b](abc)" nil nil nil nil "abcXabc" nil nil nil) +(1761 "\"abcbabc\" =~ /(?®One)[]a()b](?abc)/" "(?®One)[]a()b](?abc)" nil nil nil nil "abcbabc" nil "abcbabc" ("abc")) +(1762 "\"abcXabc\" =~ /(?®One)[]a()b](?abc)/" "(?®One)[]a()b](?abc)" nil nil nil nil "abcXabc" nil nil nil) +(1763 "\"abcXabc\" =~ /(?1)[^]a()b](abc)/" "(?1)[^]a()b](abc)" nil nil nil nil "abcXabc" nil "abcXabc" ("abc")) +(1764 "\"abcbabc\" =~ /(?1)[^]a()b](abc)/" "(?1)[^]a()b](abc)" nil nil nil nil "abcbabc" nil nil nil) +(1765 "\"abcXabc\" =~ /(?®One)[^]a()b](?abc)/" "(?®One)[^]a()b](?abc)" nil nil nil nil "abcXabc" nil "abcXabc" ("abc")) +(1766 "\"abcbabc\" =~ /(?®One)[^]a()b](?abc)/" "(?®One)[^]a()b](?abc)" nil nil nil nil "abcbabc" nil nil nil) +(1767 "\"xyzbabcxyz\" =~ /(?2)[]a()b](abc)(xyz)/" "(?2)[]a()b](abc)(xyz)" nil nil nil nil "xyzbabcxyz" nil "xyzbabcxyz" ("abc" "xyz")) +(1768 "\"xyzbabcxyz\" =~ /(?®Two)[]a()b](?abc)(xyz)/" "(?®Two)[]a()b](?abc)(xyz)" nil nil nil nil "xyzbabcxyz" nil nil nil) +(1769 "\"abcabc)/" "(?1)[]a()](?abc)" nil nil nil nil "abc)](?abc)/" "(?&N)[]a(?)](?abc)" nil nil nil nil "abc)](abc)/" "(?&N)[]a(?)](abc)" nil nil nil nil "abcabc)(?:(?i)(?®One))/ defabcabcxyz DEFabcABCXYZ + +/(?2)[]a()b](abc)/ + abcbabc + +/(?®Two)[]a()b](?)/ + abcbabc + +/(?2)[^]a()b](abc)/ + abcbabc + +/(?®Two)[^]a()b](?abc)/ + abcbabc + +/(?1)[]a()b](abc)/ + abcbabc + abcXabc + +/(?®One)[]a()b](?abc)/ + abcbabc + abcXabc + +/(?1)[^]a()b](abc)/ + abcXabc + abcbabc + +/(?®One)[^]a()b](?abc)/ + abcXabc + abcbabc + +/(?2)[]a()b](abc)(xyz)/ + xyzbabcxyz + +/(?®Two)[]a()b](?abc)(xyz)/ + xyzbabcxyz + +/(?1)[]a()](?abc)/ + abc)](?abc)/ + abc)](abc)/ + abc Date: Sat, 25 Jan 2014 10:22:49 -0500 Subject: [PATCH 073/130] Add some more tests for subpattern references. These were taken from PCRE's testdata/testinput2 with slight modifications. --- test/perltestdata | 10 ++++++++++ test/perltestinput | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index a106f39..6200f04 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14441,3 +14441,13 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1770 "\"abc)](?abc)/" "(?&N)[]a(?)](?abc)" nil nil nil nil "abc)](abc)/" "(?&N)[]a(?)](abc)" nil nil nil nil "abcd)Y/" "^X(?®Five)(a)(?:(b)|(q))(c)(?d)Y" nil nil nil nil "XYabcdY" nil nil nil) +(1775 "\"XYabcdY\" =~ /^X(?6)(a)(?:(b)|(q))(c)(d)(Y)/" "^X(?6)(a)(?:(b)|(q))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil "XYabcdY" ("a" "b" nil "c" "d" "Y")) +(1776 "\"XYabcdY\" =~ /^X(?®Six)(a)(?:(b)|(q))(c)(d)(?Y)/" "^X(?®Six)(a)(?:(b)|(q))(c)(d)(?Y)" nil nil nil nil "XYabcdY" nil "XYabcdY" ("a" "b" nil "c" "d" "Y")) +(1777 "\"XYabcdY\" =~ /^X(?7)(a)(?:(b)|(q)(r)(s))(c)(d)(Y)/" "^X(?7)(a)(?:(b)|(q)(r)(s))(c)(d)(Y)" nil nil nil nil "XYabcdY" nil nil nil) +(1778 "\"XYabcdY\" =~ /^X(?®Seven)(a)(?:(b)|(q)(r)(s))(c)(d)(?Y)/" "^X(?®Seven)(a)(?:(b)|(q)(r)(s))(c)(d)(?Y)" nil nil nil nil "XYabcdY" nil "XYabcdY" ("a" "b" nil nil nil "c" "d" "Y")) +(1779 "\"xbaax\" =~ /(?<=b(?1)|zzz)(a)/" "(?<=b(?1)|zzz)(a)" nil nil nil nil "xbaax" t nil nil) +(1780 "\"xzzzax\" =~ /(?<=b(?1)|zzz)(a)/" "(?<=b(?1)|zzz)(a)" nil nil nil nil "xzzzax" t nil nil) +(1781 "\"xbaax\" =~ /(?<=b(?®One)|zzz)(?a)/" "(?<=b(?®One)|zzz)(?a)" nil nil nil nil "xbaax" t nil nil) +(1782 "\"xzzzax\" =~ /(?<=b(?®One)|zzz)(?a)/" "(?<=b(?®One)|zzz)(?a)" nil nil nil nil "xzzzax" t nil nil) diff --git a/test/perltestinput b/test/perltestinput index 62bef80..4533486 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4249,3 +4249,29 @@ foo)/ /(?&N)[]a(?)](abc)/ abcd)Y/ + XYabcdY + +/^X(?6)(a)(?:(b)|(q))(c)(d)(Y)/ + XYabcdY + +/^X(?®Six)(a)(?:(b)|(q))(c)(d)(?Y)/ + XYabcdY + +/^X(?7)(a)(?:(b)|(q)(r)(s))(c)(d)(Y)/ + XYabcdY + +/^X(?®Seven)(a)(?:(b)|(q)(r)(s))(c)(d)(?Y)/ + XYabcdY + +/(?<=b(?1)|zzz)(a)/ + xbaax + xzzzax + +/(?<=b(?®One)|zzz)(?a)/ + xbaax + xzzzax From 82414b74b9106fe7397cdb7dce7064c9d7c1b0d5 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 25 Jan 2014 10:30:18 -0500 Subject: [PATCH 074/130] Remove FIXME comment from CONVERT-COMPOUND-PARSE-TREE method on :SUBPATTERN-REFERENCE. --- convert.lisp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/convert.lisp b/convert.lisp index 7fd551c..674e4bc 100644 --- a/convert.lisp +++ b/convert.lisp @@ -700,11 +700,9 @@ when NAME is not NIL." named-subpattern-refs accumulate-start-p)) ;; stop accumulating into STARTS-WITH - ;; FIXME: It may be possible to continue accumulating under certain - ;; circumstatnces. (setq accumulate-start-p nil) ;; Subpattern references may refer to registers that come later in the regex, - ;; so we don't validate the subpattern name/number until the entire object has + ;; so we don't validate the register name/number until the entire object has ;; been constructed. (let* ((reg (second parse-tree)) (reg-name (and (stringp reg) reg)) From da706f601a0e29e2825805836068a8d610d7a8d2 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 25 Jan 2014 10:35:12 -0500 Subject: [PATCH 075/130] Rename REFERENCED-REGISTER-MATCHERS -> REGISTER-MATCHERS. --- api.lisp | 4 ++-- closures.lisp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api.lisp b/api.lisp index 115cf38..f37800c 100644 --- a/api.lisp +++ b/api.lisp @@ -135,7 +135,7 @@ modify its first argument \(but only if it's a parse tree).")) (*zero-length-num* 0) ;; keep track of the matcher functions of registers referenced by ;; subpattern references - (referenced-register-matchers (cons nil nil)) + (register-matchers (cons nil nil)) ;; create the actual matcher function (which does all the ;; work of matching the regular expression) corresponding ;; to REGEX and at the same time set the special @@ -155,7 +155,7 @@ modify its first argument \(but only if it's a parse tree).")) (declare (special end-string-offset end-anchored-p end-string - referenced-register-matchers)) + register-matchers)) ;; now create the scanner and return it (values (create-scanner-aux match-fn (regex-min-length regex) diff --git a/closures.lisp b/closures.lisp index 5492a67..de2ab52 100644 --- a/closures.lisp +++ b/closures.lisp @@ -86,7 +86,7 @@ such that the call to NEXT-FN after the match would succeed.")) (defmethod create-matcher-aux ((register register) next-fn) (declare #.*standard-optimize-settings*) - (declare (special referenced-register-matchers subpattern-refs)) + (declare (special register-matchers subpattern-refs)) ;; the position of this REGISTER within the whole regex; we start to ;; count at 0 (let ((num (num register)) @@ -130,7 +130,7 @@ such that the call to NEXT-FN after the match would succeed.")) (declare (function inner-matcher)) ;; here comes the actual closure for REGISTER; save it is a special ;; variable so it can be called by subpattern references - (setf (getf (car referenced-register-matchers) num) + (setf (getf (car register-matchers) num) (lambda (start-pos &optional other-fn) (declare (fixnum start-pos)) (if other-fn @@ -475,15 +475,15 @@ against CHR-EXPR." (defmethod create-matcher-aux ((subpattern-reference subpattern-reference) next-fn) (declare #.*standard-optimize-settings*) - (declare (special referenced-register-matchers) + (declare (special register-matchers) (function next-fn)) - ;; Close over the special variable REFERENCED-REGISTER-MATCHERS in order to - ;; reference it during the match phase. + ;; Close over the special variable REGISTER-MATCHERS in order to reference it + ;; during the match phase. (let ((num (num subpattern-reference)) - (referenced-register-matchers referenced-register-matchers)) + (register-matchers register-matchers)) (declare (fixnum num) (function next-fn)) (lambda (start-pos) - (let ((subpattern-matcher (getf (car referenced-register-matchers) (1- num)))) + (let ((subpattern-matcher (getf (car register-matchers) (1- num)))) (funcall (the function subpattern-matcher) start-pos next-fn))))) (defmethod create-matcher-aux ((branch branch) next-fn) From 5f7af8589ef209c7e165dba4310303babfff6f54 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 25 Jan 2014 10:51:02 -0500 Subject: [PATCH 076/130] Reformat comments in the style of other comments in the package. (No periods, no capitalized sentences.) --- closures.lisp | 4 ++-- convert.lisp | 22 +++++++++++----------- optimize.lisp | 2 +- regex-class-util.lisp | 8 ++++---- test/perl-tests.lisp | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/closures.lisp b/closures.lisp index de2ab52..322dbc9 100644 --- a/closures.lisp +++ b/closures.lisp @@ -477,8 +477,8 @@ against CHR-EXPR." (declare #.*standard-optimize-settings*) (declare (special register-matchers) (function next-fn)) - ;; Close over the special variable REGISTER-MATCHERS in order to reference it - ;; during the match phase. + ;; close over the special variable REGISTER-MATCHERS in order to reference it + ;; during the match phase (let ((num (num subpattern-reference)) (register-matchers register-matchers)) (declare (fixnum num) (function next-fn)) diff --git a/convert.lisp b/convert.lisp index 674e4bc..0c5ac9c 100644 --- a/convert.lisp +++ b/convert.lisp @@ -599,16 +599,16 @@ when NAME is not NIL." (setq reg-seen t) (incf (the fixnum reg-num)) (push name reg-names) - ;; While inside registers, we cannot indiscriminately accumulate into the + ;; while inside registers, we cannot indiscriminately accumulate into the ;; special variable STARTS-WITH because recursive subpattern references ;; might cause too much of the string to be skipped or endless recursion, as ;; with: ;; (scan "(\\([^()]*(?:(?1)|\\))\\))" "(())") - ;; For now, we set ACCUMULATE-START-P to NIL if the regex has one or more + ;; for now, we set ACCUMULATE-START-P to NIL if the regex has one or more ;; subpattern references, but it may be possible to determine which ;; registers are referenced--either now or at the matcher generation ;; phase--and not needlessly throw away information that may be helpful in - ;; optimization. + ;; optimization (when has-subpattern-ref (setq accumulate-start-p nil)) (make-instance 'register @@ -701,9 +701,9 @@ when NAME is not NIL." accumulate-start-p)) ;; stop accumulating into STARTS-WITH (setq accumulate-start-p nil) - ;; Subpattern references may refer to registers that come later in the regex, + ;; subpattern references may refer to registers that come later in the regex, ;; so we don't validate the register name/number until the entire object has - ;; been constructed. + ;; been constructed (let* ((reg (second parse-tree)) (reg-name (and (stringp reg) reg)) (reg-num (and (null reg-name) @@ -718,8 +718,8 @@ when NAME is not NIL." (setf max-subpattern-ref (max max-subpattern-ref reg-num)) (pushnew reg-num numbered-subpattern-refs :test #'=))) (make-instance 'subpattern-reference - ;; For named references, register numbers will be computed - ;; later. + ;; for named references, register numbers will be computed + ;; later :num (or reg-num -1) :name (copy-seq reg-name)))) @@ -908,8 +908,8 @@ parse trees which are atoms.") ;; find which register corresponds to the given name (let* ((reg-name (name converted-tree)) (this-reg-num nil)) - ;; When more than one register have the same name, a named subpattern - ;; reference refers to the first. + ;; when more than one register have the same name, a named subpattern + ;; reference refers to the first (loop for name in reg-names for reg-index from 0 when (string= name reg-name) @@ -925,8 +925,8 @@ parse trees which are atoms.") (branch (mapc #'convert-named-subpattern-refs (list (then-regex converted-tree) (else-regex converted-tree)))) - ;; FIXME: Convert ETYPECASE -> TYPECASE once all possibilities are known to - ;; be accounted for. + ;; FIXME: convert ETYPECASE -> TYPECASE once all possibilities are known to + ;; be accounted for ((or str char-class anchor back-reference everything void)))) (defun convert (parse-tree) diff --git a/optimize.lisp b/optimize.lisp index ef9b951..dfcc006 100644 --- a/optimize.lisp +++ b/optimize.lisp @@ -509,7 +509,7 @@ into a STR object, otherwise NIL." (end-string-aux regex) ;; don't set START-OF-END-STRING-P when subpattern references are present: ;; otherwise we may think we're at the end of a string when we're actually - ;; in a forward subpattern reference. + ;; in a forward subpattern reference (when (and last-str (null subpattern-refs)) ;; if we've found something set the START-OF-END-STRING-P of ;; the leftmost STR collected accordingly and remember the diff --git a/regex-class-util.lisp b/regex-class-util.lisp index 2d833c3..a189a23 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -383,9 +383,9 @@ to this object, otherwise NIL. So, \"(.){1}\" would return true (defmethod regex-length ((subpattern-reference subpattern-reference)) (declare #.*standard-optimize-settings*) - ;; As with back references, this is possible for certain use cases; but it's + ;; as with back references, this is possible for certain use cases; but it's ;; impossible for recursive patterns, which are the main reason for subpattern - ;; references to begin with. + ;; references to begin with nil) (defmethod regex-length ((char-class char-class)) @@ -557,8 +557,8 @@ slots of STR objects further down the tree.")) (defmethod compute-offsets ((subpattern-reference subpattern-reference) start-pos) (declare #.*standard-optimize-settings*) (declare (ignore start-pos)) - ;; This is doable in limited cases but impossible for the most useful - ;; application of subpattern references, namely, recursive matching. + ;; this is doable in limited cases but impossible for the most useful + ;; application of subpattern references, namely, recursive matching nil) (defmethod compute-offsets ((filter filter) start-pos) diff --git a/test/perl-tests.lisp b/test/perl-tests.lisp index e823ec6..4792df8 100644 --- a/test/perl-tests.lisp +++ b/test/perl-tests.lisp @@ -154,8 +154,8 @@ test files." errors)))))))))) (defun has-named-register-p (parse-tree) - ;; A named register is present if :NAMED-REGISTER appears at the beginning of - ;; the list PARSE-TREE or of any of its sublists. + ;; a named register is present if :NAMED-REGISTER appears at the beginning of + ;; the list PARSE-TREE or of any of its sublists (and (consp parse-tree) (or (eql (car parse-tree) :named-register) (some #'has-named-register-p (cdr parse-tree))))) From 6d1bee46a2280614a9ad8929221caebab9676743 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 25 Jan 2014 11:55:24 -0500 Subject: [PATCH 077/130] Reformat comments added in changes adding subpattern references to 70 columns. --- api.lisp | 4 ++-- closures.lisp | 49 +++++++++++++++++++++++-------------------- convert.lisp | 48 +++++++++++++++++++++--------------------- lexer.lisp | 11 +++++----- optimize.lisp | 30 +++++++++++++------------- regex-class-util.lisp | 16 +++++++------- test/perl-tests.lisp | 4 ++-- 7 files changed, 85 insertions(+), 77 deletions(-) diff --git a/api.lisp b/api.lisp index f37800c..965875f 100644 --- a/api.lisp +++ b/api.lisp @@ -133,8 +133,8 @@ modify its first argument \(but only if it's a parse tree).")) ;; initialize the counters for CREATE-MATCHER-AUX (*rep-num* 0) (*zero-length-num* 0) - ;; keep track of the matcher functions of registers referenced by - ;; subpattern references + ;; keep track of the matcher functions of registers + ;; referenced by subpattern references (register-matchers (cons nil nil)) ;; create the actual matcher function (which does all the ;; work of matching the regular expression) corresponding diff --git a/closures.lisp b/closures.lisp index 322dbc9..09dc9ef 100644 --- a/closures.lisp +++ b/closures.lisp @@ -100,25 +100,25 @@ such that the call to NEXT-FN after the match would succeed.")) (declare (fixnum start-pos) (function next-fn)) (if saved-regs - ;; this register was entered through a subpattern reference; - ;; restore the old register arrays, and attempt to match the - ;; rest of the pattern + ;; this register was entered through a subpattern + ;; reference; restore the old register arrays, and + ;; attempt to match the rest of the pattern (let* ((*reg-starts* (second (car saved-regs))) (*regs-maybe-start* (third (car saved-regs))) (*reg-ends* (fourth (car saved-regs))) (next-fn (first (car saved-regs))) - ;; pop the saved register arrays off in case we come - ;; into this register again while matching the rest of - ;; the pattern + ;; pop the saved register arrays off in case + ;; we come into this register again while + ;; matching the rest of the pattern (regs (pop saved-regs))) (prog1 (funcall (the function next-fn) start-pos) - ;; push the saved register arrays back on so they can be - ;; restored when the stack is unwound; + ;; push the saved register arrays back on so they + ;; can be restored when the stack is unwound; (push regs saved-regs))) ;; this register was not entered through a subpattern - ;; reference; save the start and end positions, and match the - ;; rest of the pattern + ;; reference; save the start and end positions, and + ;; match the rest of the pattern (progn (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) (svref *reg-ends* num) start-pos) @@ -128,18 +128,20 @@ such that the call to NEXT-FN after the match would succeed.")) (let ((inner-matcher (create-matcher-aux (regex register) #'store-end-of-reg))) (declare (function inner-matcher)) - ;; here comes the actual closure for REGISTER; save it is a special - ;; variable so it can be called by subpattern references + ;; here comes the actual closure for REGISTER; save it in a + ;; special variable so it can be called by subpattern + ;; references (setf (getf (car register-matchers) num) (lambda (start-pos &optional other-fn) (declare (fixnum start-pos)) (if other-fn - ;; the presence of OTHER-FN indicates that this register has been - ;; entered by a subpattern reference closure; + ;; the presence of OTHER-FN indicates that this + ;; register has been entered by a subpattern reference + ;; closure; (progn - ;; create a new temporary set of registers for matching back - ;; references while inside a subpattern reference, as with - ;; Perl; save the old ones + ;; create a new temporary set of registers for + ;; matching back references while inside a subpattern + ;; reference, as with Perl; save the old ones (push (list other-fn *reg-starts* *regs-maybe-start* *reg-ends*) saved-regs) (let ((reg-num (array-dimension *reg-starts* 0))) @@ -148,8 +150,9 @@ such that the call to NEXT-FN after the match would succeed.")) *reg-ends* (make-array reg-num :initial-element nil)) (setf (svref *regs-maybe-start* num) start-pos)) (prog1 - ;; match the inner regex and the rest of the pattern; - ;; restore the original set of registers before returning + ;; match the inner regex and the rest of the + ;; pattern; restore the original set of registers + ;; before returning (funcall inner-matcher start-pos) (setf *reg-starts* (second (car saved-regs)) *regs-maybe-start* (third (car saved-regs)) @@ -158,8 +161,8 @@ such that the call to NEXT-FN after the match would succeed.")) (let ((old-*reg-starts* (svref *reg-starts* num)) (old-*regs-maybe-start* (svref *regs-maybe-start* num)) (old-*reg-ends* (svref *reg-ends* num))) - ;; we cannot use *REGS-START* here because Perl allows regular - ;; expressions like /(a|\1x)*/ + ;; we cannot use *REGS-START* here because Perl + ;; allows regular expressions like /(a|\1x)*/ (setf (svref *regs-maybe-start* num) start-pos) (let ((next-pos (funcall inner-matcher start-pos))) (unless next-pos @@ -477,8 +480,8 @@ against CHR-EXPR." (declare #.*standard-optimize-settings*) (declare (special register-matchers) (function next-fn)) - ;; close over the special variable REGISTER-MATCHERS in order to reference it - ;; during the match phase + ;; close over the special variable REGISTER-MATCHERS in order to + ;; reference it during the match phase (let ((num (num subpattern-reference)) (register-matchers register-matchers)) (declare (fixnum num) (function next-fn)) diff --git a/convert.lisp b/convert.lisp index 0c5ac9c..c800e45 100644 --- a/convert.lisp +++ b/convert.lisp @@ -318,12 +318,12 @@ it. Will also - keep track of all named registers seen in the special variable REG-NAMES - keep track of the highest backreference seen in the special variable MAX-BACK-REF, - - keep track of the highest subpattern reference seen in the special variable - MAX-SUBPATTERN-REF, - - keep track of all numbered subpattern references seen in the special - variable NUMBERED-SUBPATTERN-REFS, - - keep track of all named subpattern references seen in the special variable - NAMED-SUBPATTERN-REFS, + - keep track of the highest subpattern reference seen in the special + variable MAX-SUBPATTERN-REF, + - keep track of all numbered subpattern references seen in the + special variable NUMBERED-SUBPATTERN-REFS, + - keep track of all named subpattern references seen in the special + variable NAMED-SUBPATTERN-REFS, - maintain and adher to the currently applicable modifiers in the special variable FLAGS, and - maybe even wash your car..." @@ -599,16 +599,16 @@ when NAME is not NIL." (setq reg-seen t) (incf (the fixnum reg-num)) (push name reg-names) - ;; while inside registers, we cannot indiscriminately accumulate into the - ;; special variable STARTS-WITH because recursive subpattern references - ;; might cause too much of the string to be skipped or endless recursion, as - ;; with: + ;; while inside registers, we cannot indiscriminately accumulate + ;; into the special variable STARTS-WITH because recursive + ;; subpattern references might cause too much of the string to be + ;; skipped or endless recursion, as with: ;; (scan "(\\([^()]*(?:(?1)|\\))\\))" "(())") - ;; for now, we set ACCUMULATE-START-P to NIL if the regex has one or more - ;; subpattern references, but it may be possible to determine which - ;; registers are referenced--either now or at the matcher generation - ;; phase--and not needlessly throw away information that may be helpful in - ;; optimization + ;; for now, we set ACCUMULATE-START-P to NIL if the regex has one + ;; or more subpattern references, but it may be possible to + ;; determine which registers are referenced--either now or at the + ;; matcher generation phase--and not needlessly throw away + ;; information that may be helpful in optimization (when has-subpattern-ref (setq accumulate-start-p nil)) (make-instance 'register @@ -701,9 +701,9 @@ when NAME is not NIL." accumulate-start-p)) ;; stop accumulating into STARTS-WITH (setq accumulate-start-p nil) - ;; subpattern references may refer to registers that come later in the regex, - ;; so we don't validate the register name/number until the entire object has - ;; been constructed + ;; subpattern references may refer to registers that come later in + ;; the regex, so we don't validate the register name/number until + ;; the entire object has been constructed (let* ((reg (second parse-tree)) (reg-name (and (stringp reg) reg)) (reg-num (and (null reg-name) @@ -718,8 +718,8 @@ when NAME is not NIL." (setf max-subpattern-ref (max max-subpattern-ref reg-num)) (pushnew reg-num numbered-subpattern-refs :test #'=))) (make-instance 'subpattern-reference - ;; for named references, register numbers will be computed - ;; later + ;; for named references, register numbers will be + ;; computed later :num (or reg-num -1) :name (copy-seq reg-name)))) @@ -908,8 +908,8 @@ parse trees which are atoms.") ;; find which register corresponds to the given name (let* ((reg-name (name converted-tree)) (this-reg-num nil)) - ;; when more than one register have the same name, a named subpattern - ;; reference refers to the first + ;; when more than one register have the same name, a named + ;; subpattern reference refers to the first (loop for name in reg-names for reg-index from 0 when (string= name reg-name) @@ -925,8 +925,8 @@ parse trees which are atoms.") (branch (mapc #'convert-named-subpattern-refs (list (then-regex converted-tree) (else-regex converted-tree)))) - ;; FIXME: convert ETYPECASE -> TYPECASE once all possibilities are known to - ;; be accounted for + ;; FIXME: convert ETYPECASE -> TYPECASE once all possibilities are + ;; known to be accounted for ((or str char-class anchor back-reference everything void)))) (defun convert (parse-tree) diff --git a/lexer.lisp b/lexer.lisp index c79d8ac..40fe53f 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -473,10 +473,10 @@ resets the lexer to its old position." (fail lexer))))) (defun parse-register-name-aux (lexer &key subpattern-reference) - "Reads and returns the name in a named register group or reference. It is -assumed that the starting #\\< character \(or \"\(?&\" string when -SUBPATTERN-REFERENCE is true) has already been read. The closing #\> \(or #\\)) -will also be consumed." + "Reads and returns the name in a named register group or reference. +It is assumed that the starting #\\< character \(or \"\(?&\" string +when SUBPATTERN-REFERENCE is true) has already been read. The closing +#\> \(or #\\)) will also be consumed." ;; we have to look for an ending > or ) character now (let ((end-name (position (if subpattern-reference #\) #\>) (lexer-str lexer) @@ -722,7 +722,8 @@ will also be consumed." (let ((next-char (next-char lexer))) (when (or (null next-char) (not (char= (the character next-char) #\)))) - ;; closing ) missing or not in the proper position + ;; closing ) missing or not in the + ;; proper position (signal-syntax-error* (1- (lexer-pos lexer)) "Numbered subpattern reference has no closing #\\)."))))) diff --git a/optimize.lisp b/optimize.lisp index dfcc006..bbd21dd 100644 --- a/optimize.lisp +++ b/optimize.lisp @@ -119,9 +119,9 @@ operation on REGEX.")) (flatten (regex regex))) regex) (t - ;; otherwise (ANCHOR, BACK-REFERENCE, SUBPATTERN-REFERENCE, CHAR-CLASS, - ;; EVERYTHING, LOOKAHEAD, LOOKBEHIND, STR, VOID, FILTER, and - ;; WORD-BOUNDARY) do nothing + ;; otherwise (ANCHOR, BACK-REFERENCE, SUBPATTERN-REFERENCE, + ;; CHAR-CLASS, EVERYTHING, LOOKAHEAD, LOOKBEHIND, STR, VOID, + ;; FILTER, and WORD-BOUNDARY) do nothing regex))) (defgeneric gather-strings (regex) @@ -278,9 +278,9 @@ operation on REGEX.")) (gather-strings (regex regex))) regex) (t - ;; otherwise (ANCHOR, BACK-REFERENCE, SUBPATTERN-REFERENCE, CHAR-CLASS, - ;; EVERYTHING, LOOKAHEAD, LOOKBEHIND, STR, VOID, FILTER, and - ;; WORD-BOUNDARY) do nothing + ;; otherwise (ANCHOR, BACK-REFERENCE, SUBPATTERN-REFERENCE, + ;; CHAR-CLASS, EVERYTHING, LOOKAHEAD, LOOKBEHIND, STR, VOID, + ;; FILTER, and WORD-BOUNDARY) do nothing regex))) ;; Note that START-ANCHORED-P will be called after FLATTEN and GATHER-STRINGS. @@ -356,7 +356,8 @@ zero-length assertion.")) :zero-length nil)) (t - ;; BACK-REFERENCE, SUBPATTERN-REFERENCE, CHAR-CLASS, EVERYTHING, and STR + ;; BACK-REFERENCE, SUBPATTERN-REFERENCE, CHAR-CLASS, EVERYTHING, + ;; and STR nil))) ;; Note that END-STRING-AUX will be called after FLATTEN and GATHER-STRINGS. @@ -381,10 +382,11 @@ function called by END-STRING.)")) (eq (case-insensitive-p str) old-case-insensitive-p))) ;; set the SKIP property of this STR (setf last-str str) - ;; only apply the "skip" optimization when there are no subpattern - ;; references: otherwise we may skip thinking we're at the end of the - ;; string when in fact we're just inside a forward subpattern - ;; reference; we could do better here, but it's probably not worth it + ;; only apply the "skip" optimization when there are no + ;; subpattern references: otherwise we may skip thinking + ;; we're at the end of the string when in fact we're just + ;; inside a forward subpattern reference; we could do better + ;; here, but it's probably not worth it (when (null subpattern-refs) (setf (skip str) t)) str) @@ -507,9 +509,9 @@ into a STR object, otherwise NIL." (declare (special continuep last-str)) (prog1 (end-string-aux regex) - ;; don't set START-OF-END-STRING-P when subpattern references are present: - ;; otherwise we may think we're at the end of a string when we're actually - ;; in a forward subpattern reference + ;; don't set START-OF-END-STRING-P when subpattern references + ;; are present: otherwise we may think we're at the end of a + ;; string when we're actually in a forward subpattern reference (when (and last-str (null subpattern-refs)) ;; if we've found something set the START-OF-END-STRING-P of ;; the leftmost STR collected accordingly and remember the diff --git a/regex-class-util.lisp b/regex-class-util.lisp index a189a23..d2c22eb 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -318,8 +318,9 @@ to this object, otherwise NIL. So, \"(.){1}\" would return true (defmethod everythingp ((regex regex)) (declare #.*standard-optimize-settings*) - ;; the general case for ANCHOR, BACK-REFERENCE, SUBPATTERN-REFERENCE, BRANCH, - ;; CHAR-CLASS, LOOKAHEAD, LOOKBEHIND, STR, VOID, FILTER, and WORD-BOUNDARY + ;; the general case for ANCHOR, BACK-REFERENCE, + ;; SUBPATTERN-REFERENCE, BRANCH, CHAR-CLASS, LOOKAHEAD, LOOKBEHIND, + ;; STR, VOID, FILTER, and WORD-BOUNDARY nil) (defgeneric regex-length (regex) @@ -383,9 +384,9 @@ to this object, otherwise NIL. So, \"(.){1}\" would return true (defmethod regex-length ((subpattern-reference subpattern-reference)) (declare #.*standard-optimize-settings*) - ;; as with back references, this is possible for certain use cases; but it's - ;; impossible for recursive patterns, which are the main reason for subpattern - ;; references to begin with + ;; as with back references, this is possible for certain use cases; + ;; but it's impossible for recursive patterns, which are the main + ;; reason for subpattern references to begin with nil) (defmethod regex-length ((char-class char-class)) @@ -557,8 +558,9 @@ slots of STR objects further down the tree.")) (defmethod compute-offsets ((subpattern-reference subpattern-reference) start-pos) (declare #.*standard-optimize-settings*) (declare (ignore start-pos)) - ;; this is doable in limited cases but impossible for the most useful - ;; application of subpattern references, namely, recursive matching + ;; this is doable in limited cases but impossible for the most + ;; useful application of subpattern references, namely, recursive + ;; matching nil) (defmethod compute-offsets ((filter filter) start-pos) diff --git a/test/perl-tests.lisp b/test/perl-tests.lisp index 4792df8..5695c75 100644 --- a/test/perl-tests.lisp +++ b/test/perl-tests.lisp @@ -154,8 +154,8 @@ test files." errors)))))))))) (defun has-named-register-p (parse-tree) - ;; a named register is present if :NAMED-REGISTER appears at the beginning of - ;; the list PARSE-TREE or of any of its sublists + ;; a named register is present if :NAMED-REGISTER appears at the + ;; beginning of the list PARSE-TREE or of any of its sublists (and (consp parse-tree) (or (eql (car parse-tree) :named-register) (some #'has-named-register-p (cdr parse-tree))))) From 2852e76d35baae98696fa091e202314e649566ec Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 7 Feb 2014 19:28:53 -0500 Subject: [PATCH 078/130] Add FILTER and WORD-BOUNDARY to the default ETYPECASE clause in CONVERT-NAMED-SUBPATTERN-REF. I believe this exhausts all possibilities that need to be covered. --- convert.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert.lisp b/convert.lisp index c800e45..e47c129 100644 --- a/convert.lisp +++ b/convert.lisp @@ -927,7 +927,7 @@ parse trees which are atoms.") (else-regex converted-tree)))) ;; FIXME: convert ETYPECASE -> TYPECASE once all possibilities are ;; known to be accounted for - ((or str char-class anchor back-reference everything void)))) + ((or str char-class anchor back-reference everything filter word-boundary void)))) (defun convert (parse-tree) "Converts the parse tree PARSE-TREE into an equivalent REGEX object and From 7d1ed2b143b9b5db7b880a79f92896444fe9fe4c Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 7 Feb 2014 20:07:29 -0500 Subject: [PATCH 079/130] Convert ETYPECASE -> TYPECASE, since all possibilities are accounted for. Also, add a test for using subpattern references with the :FILTER feature. --- convert.lisp | 7 ++----- test/simple | 10 ++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/convert.lisp b/convert.lisp index e47c129..bb0613c 100644 --- a/convert.lisp +++ b/convert.lisp @@ -902,7 +902,7 @@ parse trees which are atoms.") "Convert named subpattern references to numbered references." (declare #.*standard-optimize-settings*) (declare (special reg-names reg-num numbered-subpattern-refs)) - (etypecase converted-tree + (typecase converted-tree (subpattern-reference (when (= -1 (num converted-tree)) ;; find which register corresponds to the given name @@ -924,10 +924,7 @@ parse trees which are atoms.") (convert-named-subpattern-refs (regex converted-tree))) (branch (mapc #'convert-named-subpattern-refs (list (then-regex converted-tree) - (else-regex converted-tree)))) - ;; FIXME: convert ETYPECASE -> TYPECASE once all possibilities are - ;; known to be accounted for - ((or str char-class anchor back-reference everything filter word-boundary void)))) + (else-regex converted-tree)))))) (defun convert (parse-tree) "Converts the parse tree PARSE-TREE into an equivalent REGEX object and diff --git a/test/simple b/test/simple index 8c86c34..479b16b 100644 --- a/test/simple +++ b/test/simple @@ -364,3 +364,13 @@ characters if there's a match." (regex-replace-all (create-scanner "\\p{even}") "abcd" "+") (regex-replace-all (create-scanner "\\p{true}") "abcd" "+"))) '("+b+d" "a+c+" "++++"))) + +(equalp (multiple-value-list + (scan (create-scanner `(:sequence + "f" + (:filter ,(lambda (pos) pos)) + (:named-register "reg" "o") + (:filter ,(lambda (pos) pos)) + (:subpattern-reference "reg"))) + "foo")) + '(0 3 #(1) #(2))) From eed3e27dbee2e7f7ba1952141077adbdcbed10b1 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 8 Feb 2014 09:20:51 -0500 Subject: [PATCH 080/130] Add a test for handling back-references within subpattern references referring to registers outside the referenced subpattern. This currently fails. When entering into a subpattern reference, Perl only creates new registers for those capture groups located inside the subpattern reference. The capture groups outside the subpattern reference retain their values. --- test/perltestdata | 2 ++ test/perltestinput | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index 6200f04..a54c7ff 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14451,3 +14451,5 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1780 "\"xzzzax\" =~ /(?<=b(?1)|zzz)(a)/" "(?<=b(?1)|zzz)(a)" nil nil nil nil "xzzzax" t nil nil) (1781 "\"xbaax\" =~ /(?<=b(?®One)|zzz)(?a)/" "(?<=b(?®One)|zzz)(?a)" nil nil nil nil "xbaax" t nil nil) (1782 "\"xzzzax\" =~ /(?<=b(?®One)|zzz)(?a)/" "(?<=b(?®One)|zzz)(?a)" nil nil nil nil "xzzzax" t nil nil) +(1783 "\"fofof\" =~ /(.)((o)\\1)(?2)/" "(.)((o)\\1)(?2)" nil nil nil nil "fofof" nil "fofof" ("f" "of" "o")) +(1784 "\"fofog\" =~ /(.)((o)\\1)(?2)/" "(.)((o)\\1)(?2)" nil nil nil nil "fofog" nil nil nil) diff --git a/test/perltestinput b/test/perltestinput index 4533486..7b0a5d3 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4275,3 +4275,7 @@ foo)/ /(?<=b(?®One)|zzz)(?a)/ xbaax xzzzax + +/(.)((o)\1)(?2)/ + fofof + fofog From 10a6af64dc0bb66b170c0eb7589a9801f9193529 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 07:30:53 -0500 Subject: [PATCH 081/130] Add some more tests verifying correct behavior of subpattern- and back-reference cooperation. --- test/perltestdata | 18 +++++++++++++++++ test/perltestinput | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index a54c7ff..77e7469 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14453,3 +14453,21 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1782 "\"xzzzax\" =~ /(?<=b(?®One)|zzz)(?a)/" "(?<=b(?®One)|zzz)(?a)" nil nil nil nil "xzzzax" t nil nil) (1783 "\"fofof\" =~ /(.)((o)\\1)(?2)/" "(.)((o)\\1)(?2)" nil nil nil nil "fofof" nil "fofof" ("f" "of" "o")) (1784 "\"fofog\" =~ /(.)((o)\\1)(?2)/" "(.)((o)\\1)(?2)" nil nil nil nil "fofog" nil nil nil) +(1785 "\"fofof\" =~ /(?.)(?(o)\\k)(?®Two)/" "(?.)(?(o)\\k)(?®Two)" nil nil nil nil "fofof" nil "fofof" ("f" "of" "o")) +(1786 "\"fofog\" =~ /(?.)(?(o)\\k)(?®Two)/" "(?.)(?(o)\\k)(?®Two)" nil nil nil nil "fofog" nil nil nil) +(1787 "\"ffff\" =~ /(.)(((?5))(\\1))((?4))/" "(.)(((?5))(\\1))((?4))" nil nil nil nil "ffff" nil nil nil) +(1788 "\"ffff\" =~ /(?.)(((?®Five))(?\\k))(?(?®Four))/" "(?.)(((?®Five))(?\\k))(?(?®Four))" nil nil nil nil "ffff" nil nil nil) +(1789 "\"fooo\" =~ /(.)(((?5))(\\3))((?4))/" "(.)(((?5))(\\3))((?4))" nil nil nil nil "fooo" nil nil nil) +(1790 "\"fooo\" =~ /(.)((?(?®Five))(?\\k))(?(?®Four))/" "(.)((?(?®Five))(?\\k))(?(?®Four))" nil nil nil nil "fooo" nil nil nil) +(1791 "\"oo\" =~ /(?1)((.)\\2)?/" "(?1)((.)\\2)?" nil nil nil nil "oo" nil "oo" nil) +(1792 "\"aa\" =~ /(?1)((.)\\2)?/" "(?1)((.)\\2)?" nil nil nil nil "aa" nil "aa" nil) +(1793 "\"oo\" =~ /(?®One)(?(?.)\\k)?/" "(?®One)(?(?.)\\k)?" nil nil nil nil "oo" nil "oo" nil) +(1794 "\"aa\" =~ /(?®One)(?(?.)\\k)?/" "(?®One)(?(?.)\\k)?" nil nil nil nil "aa" nil "aa" nil) +(1795 "\"ffff\" =~ /(?1)((.)\\2)/" "(?1)((.)\\2)" nil nil nil nil "ffff" nil "ffff" ("ff" "f")) +(1796 "\"ffff\" =~ /(?®One)(?(?.)\\k)/" "(?®One)(?(?.)\\k)" nil nil nil nil "ffff" nil "ffff" ("ff" "f")) +(1797 "\"ffffff\" =~ /(?1)((.)(?3)(\\2))/" "(?1)((.)(?3)(\\2))" nil nil nil nil "ffffff" nil nil nil) +(1798 "\"ffffff\" =~ /(?®One)(?(?.)(?®Three)(\\k))/" "(?®One)(?(?.)(?®Three)(\\k))" nil nil nil nil "ffffff" t nil nil) +(1799 "\"foffoff\" =~ /(.)(?2)((.)(?4)(\\1))/" "(.)(?2)((.)(?4)(\\1))" nil nil nil nil "foffoff" nil nil nil) +(1800 "\"foffoff\" =~ /(?.)(?®Two)(?(.)(?®Four)(?\\k))/" "(?.)(?®Two)(?(.)(?®Four)(?\\k))" nil nil nil nil "foffoff" nil nil nil) +(1801 "\"fffffff\" =~ /(.)(?2)((\\1)(?4)(\\1))/" "(.)(?2)((\\1)(?4)(\\1))" nil nil nil nil "fffffff" nil nil nil) +(1802 "\"fffffff\" =~ /(?.)(?®Two)(?(\\k)(?®Four)(?\\k))/" "(?.)(?®Two)(?(\\k)(?®Four)(?\\k))" nil nil nil nil "fffffff" nil nil nil) diff --git a/test/perltestinput b/test/perltestinput index 7b0a5d3..bdf5726 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4279,3 +4279,51 @@ foo)/ /(.)((o)\1)(?2)/ fofof fofog + +/(?.)(?(o)\k)(?®Two)/ + fofof + fofog + +/(.)(((?5))(\1))((?4))/ + ffff + +/(?.)(((?®Five))(?\k))(?(?®Four))/ + ffff + +/(.)(((?5))(\3))((?4))/ + fooo + +/(.)((?(?®Five))(?\k))(?(?®Four))/ + fooo + +/(?1)((.)\2)?/ + oo + aa + +/(?®One)(?(?.)\k)?/ + oo + aa + +/(?1)((.)\2)/ + ffff + +/(?®One)(?(?.)\k)/ + ffff + +/(?1)((.)(?3)(\2))/ + ffffff + +/(?®One)(?(?.)(?®Three)(\k))/ + ffffff + +/(.)(?2)((.)(?4)(\1))/ + foffoff + +/(?.)(?®Two)(?(.)(?®Four)(?\k))/ + foffoff + +/(.)(?2)((\1)(?4)(\1))/ + fffffff + +/(?.)(?®Two)(?(\k)(?®Four)(?\k))/ + fffffff From c3c5e0629c4e7d585ba604ab5f48523092b4cfa0 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 07:50:22 -0500 Subject: [PATCH 082/130] Begin transitioning to the new register offsets storage model. Instead of storing the beginning/end of register offsets directly in the corresponding arrays, we will now store lists where the car of each list is the offset. The reason for this is that when we descend into a subpattern reference, instead of making a new array where all offsets are reset, we will push new offsets onto the front of the lists corresponding only to those registers contained within the register we're entering via the subpattern reference. In other words, we'll only be resetting certain registers. This will fix tests 1783 and 1785. Which registers contain which other registers will be computed during regex compilation. --- scanner.lisp | 17 +++++++++-------- specials.lisp | 11 +++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/scanner.lisp b/scanner.lisp index 168dc6b..2ac63dd 100644 --- a/scanner.lisp +++ b/scanner.lisp @@ -174,10 +174,11 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX." (setq *last-pos-stores* (make-array zero-length-num :initial-element nil))) (when (plusp reg-num) - ;; we have registers in our regular expression - (setq *reg-starts* (make-array reg-num :initial-element nil) - *regs-maybe-start* (make-array reg-num :initial-element nil) - *reg-ends* (make-array reg-num :initial-element nil))) + (flet ((list-nil () (list nil))) + ;; we have registers in our regular expression + (setq *reg-starts* (map-into (make-array reg-num) #'list-nil) + *regs-maybe-start* (map-into (make-array reg-num) #'list-nil) + *reg-ends* (map-into (make-array reg-num) #'list-nil)))) (when end-anchored-p ;; the regular expression has a constant end string which ;; is anchored at the very end of the target string @@ -282,8 +283,8 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX." (when next-pos (values (if next-pos *start-pos* nil) next-pos - *reg-starts* - *reg-ends*)))) + (map-into *reg-starts* #'car *reg-starts*) + (map-into *reg-ends* #'car *reg-ends*))))) (t (loop for pos = (if starts-with-everything ;; don't jump to the next @@ -300,8 +301,8 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX." (when next-pos (return-from scan (values pos next-pos - *reg-starts* - *reg-ends*))) + (map-into *reg-starts* #'car *reg-starts*) + (map-into *reg-ends* #'car *reg-ends*)))) ;; not yet found, increment POS #-cormanlisp (incf (the fixnum pos)) #+cormanlisp (incf pos))))))))) diff --git a/specials.lisp b/specials.lisp index 547a1ab..d4ad45f 100644 --- a/specials.lisp +++ b/specials.lisp @@ -83,18 +83,17 @@ Will always be coerced to a SIMPLE-STRING.") (declaim (fixnum *end-pos*)) (defvar *reg-starts* (make-array 0) - "An array which holds the start positions -of the current register candidates.") + "An array holding lists where the car of each list is the offset of +the start position of the register numbered by that index.") (declaim (simple-vector *reg-starts*)) (defvar *regs-maybe-start* (make-array 0) - "An array which holds the next start positions -of the current register candidates.") + "Same as *REG-STARTS*, except these values may be spurious.") (declaim (simple-vector *regs-maybe-start*)) (defvar *reg-ends* (make-array 0) - "An array which holds the end positions -of the current register candidates.") + "An array holding lists where the car of each list is the offset of +the end position of the register numbered by that index.") (declaim (simple-vector *reg-ends*)) (defvar *end-string-pos* nil From 3891ee541d1d7e462b2624a6300ba69d769e04cf Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 08:01:48 -0500 Subject: [PATCH 083/130] Continue transitioning to the new register offsets storage model. --- closures.lisp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/closures.lisp b/closures.lisp index 09dc9ef..eb3df2b 100644 --- a/closures.lisp +++ b/closures.lisp @@ -446,8 +446,8 @@ against CHR-EXPR." ;; the case-insensitive version (lambda (start-pos) (declare (fixnum start-pos)) - (let ((reg-start (svref *reg-starts* num)) - (reg-end (svref *reg-ends* num))) + (let ((reg-start (car (svref *reg-starts* num))) + (reg-end (car (svref *reg-ends* num)))) ;; only bother to check if the corresponding REGISTER as ;; matched successfully already (and reg-start @@ -462,8 +462,8 @@ against CHR-EXPR." ;; the case-sensitive version (lambda (start-pos) (declare (fixnum start-pos)) - (let ((reg-start (svref *reg-starts* num)) - (reg-end (svref *reg-ends* num))) + (let ((reg-start (car (svref *reg-starts* num))) + (reg-end (car (svref *reg-ends* num)))) ;; only bother to check if the corresponding REGISTER as ;; matched successfully already (and reg-start @@ -499,7 +499,7 @@ against CHR-EXPR." (lambda (start-pos) (declare (fixnum test)) (if (and (< test (length *reg-starts*)) - (svref *reg-starts* test)) + (car (svref *reg-starts* test))) (funcall then-matcher start-pos) (funcall else-matcher start-pos)))) (t From 2b40341b7f2523bc4354f7c627f12febd6c9c45a Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 08:34:22 -0500 Subject: [PATCH 084/130] Add CONTAINING-REGISTERS slot to REGISTER class. --- regex-class.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/regex-class.lisp b/regex-class.lisp index 2d1fc2f..3558024 100644 --- a/regex-class.lisp +++ b/regex-class.lisp @@ -123,7 +123,11 @@ register.")) This is the index into *REGS-START* and *REGS-END*.") (name :initarg :name :reader name - :documentation "Name of this register or NIL.")) + :documentation "Name of this register or NIL.") + (containing-registers :accessor containing-registers + :type list + :initform nil + :documentation "A list of registers (by number) nested within this register.")) (:documentation "REGISTER objects represent register groups.")) (defmethod print-object ((register register) stream) From 6c6771a8a94d7507880f09fa176d98d89a13e137 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 09:43:17 -0500 Subject: [PATCH 085/130] Compute CONTAINING-REGISTERS slot of REGISTER instances. --- convert.lisp | 23 +++++++++++++++++------ regex-class.lisp | 6 +++--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/convert.lisp b/convert.lisp index bb0613c..6a8ba4d 100644 --- a/convert.lisp +++ b/convert.lisp @@ -587,7 +587,8 @@ called with GREEDYP set to NIL as you would expect." "The case for \(:REGISTER ). Also used for named registers when NAME is not NIL." (declare #.*standard-optimize-settings*) - (declare (special flags reg-num reg-names has-subpattern-ref accumulate-start-p)) + (declare (special flags reg-num reg-names has-subpattern-ref + accumulate-start-p containing-registers)) ;; keep the effect of modifiers local to the enclosed regex; also, ;; assign the current value of REG-NUM to the corresponding slot of ;; the REGISTER object and increase this counter afterwards; for @@ -599,6 +600,7 @@ when NAME is not NIL." (setq reg-seen t) (incf (the fixnum reg-num)) (push name reg-names) + (push stored-reg-num containing-registers) ;; while inside registers, we cannot indiscriminately accumulate ;; into the special variable STARTS-WITH because recursive ;; subpattern references might cause too much of the string to be @@ -611,10 +613,17 @@ when NAME is not NIL." ;; information that may be helpful in optimization (when has-subpattern-ref (setq accumulate-start-p nil)) - (make-instance 'register - :regex (convert-aux (if name (third parse-tree) (second parse-tree))) - :num stored-reg-num - :name name))) + (let (stored-containing-registers regex) + (let (containing-registers) + (declare (special containing-registers)) + (setf regex (convert-aux (if name (third parse-tree) (second parse-tree))) + stored-containing-registers containing-registers)) + (setf containing-registers (append stored-containing-registers containing-registers)) + (make-instance 'register + :regex regex + :num stored-reg-num + :name name + :containing-registers stored-containing-registers)))) (defmethod convert-compound-parse-tree ((token (eql :named-register)) parse-tree &key) "The case for \(:NAMED-REGISTER )." @@ -946,6 +955,7 @@ by subpattern references in the REGEX." (max-back-ref 0) (max-subpattern-ref 0) (has-subpattern-ref (has-subpattern-ref-p parse-tree)) + containing-registers (converted-parse-tree (convert-aux parse-tree))) (declare (special flags reg-num reg-names @@ -955,7 +965,8 @@ by subpattern references in the REGEX." max-subpattern-ref numbered-subpattern-refs named-subpattern-refs - has-subpattern-ref)) + has-subpattern-ref + containing-registers)) ;; make sure we don't reference registers which aren't there (when (> (the fixnum max-back-ref) (the fixnum reg-num)) diff --git a/regex-class.lisp b/regex-class.lisp index 3558024..7274a2a 100644 --- a/regex-class.lisp +++ b/regex-class.lisp @@ -124,10 +124,10 @@ This is the index into *REGS-START* and *REGS-END*.") (name :initarg :name :reader name :documentation "Name of this register or NIL.") - (containing-registers :accessor containing-registers + (containing-registers :initarg :containing-registers + :reader containing-registers :type list - :initform nil - :documentation "A list of registers (by number) nested within this register.")) + :documentation "A list of registers (by number, zero-based) nested within this register.")) (:documentation "REGISTER objects represent register groups.")) (defmethod print-object ((register register) stream) From 474b91ae883139d0e56b4255222f910c952f9fed Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 11:06:28 -0500 Subject: [PATCH 086/130] Continue transition to new register offsets storage model. At this points, I had expected everything to work as well as with the old model, but there are still many tests that are failing, so apparently there are some bugs left to iron out. --- closures.lisp | 94 ++++++++++++++++++++++++------------------- regex-class-util.lisp | 3 +- 2 files changed, 55 insertions(+), 42 deletions(-) diff --git a/closures.lisp b/closures.lisp index eb3df2b..09a8249 100644 --- a/closures.lisp +++ b/closures.lisp @@ -90,38 +90,51 @@ such that the call to NEXT-FN after the match would succeed.")) ;; the position of this REGISTER within the whole regex; we start to ;; count at 0 (let ((num (num register)) - saved-regs) + (containing-registers (containing-registers register)) + subpattern-ref-continuations) (declare (fixnum num) - (list saved-regs)) + (list subpattern-ref-continuations)) ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which will - ;; update the corresponding values of *REGS-START* and *REGS-END* + ;; update the corresponding values of *REG-STARTS* and *REG-ENDS* ;; after the inner matcher has succeeded (flet ((store-end-of-reg (start-pos) (declare (fixnum start-pos) (function next-fn)) - (if saved-regs + (if subpattern-ref-continuations ;; this register was entered through a subpattern - ;; reference; restore the old register arrays, and + ;; reference; restore the old register offsets, and ;; attempt to match the rest of the pattern - (let* ((*reg-starts* (second (car saved-regs))) - (*regs-maybe-start* (third (car saved-regs))) - (*reg-ends* (fourth (car saved-regs))) - (next-fn (first (car saved-regs))) - ;; pop the saved register arrays off in case - ;; we come into this register again while - ;; matching the rest of the pattern - (regs (pop saved-regs))) + (let ((saved-starts (mapcar (lambda (idx) + (pop (svref *reg-starts* idx))) + containing-registers)) + (saved-maybe-starts (mapcar (lambda (idx) + (pop (svref *regs-maybe-start* idx))) + containing-registers)) + (saved-ends (mapcar (lambda (idx) + (pop (svref *reg-ends* idx))) + containing-registers)) + (next-fn (pop subpattern-ref-continuations))) (prog1 (funcall (the function next-fn) start-pos) - ;; push the saved register arrays back on so they - ;; can be restored when the stack is unwound; - (push regs saved-regs))) + ;; push the saved register offsets back on so + ;; they can be restored when the stack is + ;; unwound; + (mapc (lambda (idx) + (push (pop saved-starts) (svref *reg-starts* idx))) + containing-registers) + (mapc (lambda (idx) + (push (pop saved-maybe-starts) (svref *regs-maybe-start* idx))) + containing-registers) + (mapc (lambda (idx) + (push (pop saved-ends) (svref *reg-ends* idx))) + containing-registers) + (push next-fn subpattern-ref-continuations))) ;; this register was not entered through a subpattern ;; reference; save the start and end positions, and ;; match the rest of the pattern (progn - (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) - (svref *reg-ends* num) start-pos) + (setf (car (svref *reg-starts* num)) (car (svref *regs-maybe-start* num)) + (car (svref *reg-ends* num)) start-pos) (funcall next-fn start-pos))))) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER @@ -139,37 +152,36 @@ such that the call to NEXT-FN after the match would succeed.")) ;; register has been entered by a subpattern reference ;; closure; (progn - ;; create a new temporary set of registers for - ;; matching back references while inside a subpattern + ;; create a new temporary set of register offsets for + ;; those registers contained within this one in order + ;; to match back references while inside a subpattern ;; reference, as with Perl; save the old ones - (push (list other-fn *reg-starts* *regs-maybe-start* *reg-ends*) - saved-regs) - (let ((reg-num (array-dimension *reg-starts* 0))) - (setf *reg-starts* (make-array reg-num :initial-element nil) - *regs-maybe-start* (make-array reg-num :initial-element nil) - *reg-ends* (make-array reg-num :initial-element nil)) - (setf (svref *regs-maybe-start* num) start-pos)) + (push other-fn subpattern-ref-continuations) + (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*)) + (dolist (idx containing-registers) + (push nil (svref a idx)))) + (setf (car (svref *regs-maybe-start* num)) start-pos) (prog1 ;; match the inner regex and the rest of the - ;; pattern; restore the original set of registers - ;; before returning + ;; pattern; restore the original set of register + ;; offsets before returning (funcall inner-matcher start-pos) - (setf *reg-starts* (second (car saved-regs)) - *regs-maybe-start* (third (car saved-regs)) - *reg-ends* (fourth (car saved-regs))) - (pop saved-regs))) - (let ((old-*reg-starts* (svref *reg-starts* num)) - (old-*regs-maybe-start* (svref *regs-maybe-start* num)) - (old-*reg-ends* (svref *reg-ends* num))) - ;; we cannot use *REGS-START* here because Perl + (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*)) + (dolist (idx containing-registers) + (pop (svref a idx)))) + (pop subpattern-ref-continuations))) + (let ((old-*reg-starts* (car (svref *reg-starts* num))) + (old-*regs-maybe-start* (car (svref *regs-maybe-start* num))) + (old-*reg-ends* (car (svref *reg-ends* num)))) + ;; we cannot use *REG-STARTS* here because Perl ;; allows regular expressions like /(a|\1x)*/ - (setf (svref *regs-maybe-start* num) start-pos) + (setf (car (svref *regs-maybe-start* num)) start-pos) (let ((next-pos (funcall inner-matcher start-pos))) (unless next-pos ;; restore old values on failure - (setf (svref *reg-starts* num) old-*reg-starts* - (svref *regs-maybe-start* num) old-*regs-maybe-start* - (svref *reg-ends* num) old-*reg-ends*)) + (setf (car (svref *reg-starts* num)) old-*reg-starts* + (car (svref *regs-maybe-start* num)) old-*regs-maybe-start* + (car (svref *reg-ends* num)) old-*reg-ends*)) next-pos))))))))) (defmethod create-matcher-aux ((lookahead lookahead) next-fn) diff --git a/regex-class-util.lisp b/regex-class-util.lisp index d2c22eb..8b55252 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -146,7 +146,8 @@ which are not of type STR.")) (make-instance 'register :regex (copy-regex (regex register)) :num (num register) - :name (name register))) + :name (name register) + :containing-registers (containing-registers register))) (defmethod copy-regex ((standalone standalone)) (declare #.*standard-optimize-settings*) From d938c89d85e786bd834648e41708378ad51dad59 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 14:31:40 -0500 Subject: [PATCH 087/130] Add some test cases that illumine one of the current register offsets storage model's defects. --- test/perltestdata | 6 ++++++ test/perltestinput | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index 77e7469..35c2e77 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14471,3 +14471,9 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1800 "\"foffoff\" =~ /(?.)(?®Two)(?(.)(?®Four)(?\\k))/" "(?.)(?®Two)(?(.)(?®Four)(?\\k))" nil nil nil nil "foffoff" nil nil nil) (1801 "\"fffffff\" =~ /(.)(?2)((\\1)(?4)(\\1))/" "(.)(?2)((\\1)(?4)(\\1))" nil nil nil nil "fffffff" nil nil nil) (1802 "\"fffffff\" =~ /(?.)(?®Two)(?(\\k)(?®Four)(?\\k))/" "(?.)(?®Two)(?(\\k)(?®Four)(?\\k))" nil nil nil nil "fffffff" nil nil nil) +(1803 "\"a\" =~ /(a(?1)?)/" "(a(?1)?)" nil nil nil nil "a" nil "a" ("a")) +(1804 "\"aa\" =~ /(a(?1)?)/" "(a(?1)?)" nil nil nil nil "aa" nil "aa" ("aa")) +(1805 "\"aaa\" =~ /(a(?1)?)/" "(a(?1)?)" nil nil nil nil "aaa" nil "aaa" ("aaa")) +(1806 "\"a\" =~ /(?a(?®One)?)/" "(?a(?®One)?)" nil nil nil nil "a" nil "a" ("a")) +(1807 "\"aa\" =~ /(?a(?®One)?)/" "(?a(?®One)?)" nil nil nil nil "aa" nil "aa" ("aa")) +(1808 "\"aaa\" =~ /(?a(?®One)?)/" "(?a(?®One)?)" nil nil nil nil "aaa" nil "aaa" ("aaa")) diff --git a/test/perltestinput b/test/perltestinput index bdf5726..cabf7c8 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4327,3 +4327,13 @@ foo)/ /(?.)(?®Two)(?(\k)(?®Four)(?\k))/ fffffff + +/(a(?1)?)/ + a + aa + aaa + +/(?a(?®One)?)/ + a + aa + aaa From ffeff749d8dd2d0b0b2c06e4df0677b588afc686 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 14:48:29 -0500 Subject: [PATCH 088/130] Don't store possible register offset of register entered via subpattern reference. This was causing many tests to fail with bizarre error messages. It wasn't caught using the old register offsets storage model since the array the value was beging stored in was a temporary array to begin with. With this commit, the only tests run by RUN-ALL-TESTS that fail are those that Perl itself gets wrong. --- closures.lisp | 1 - 1 file changed, 1 deletion(-) diff --git a/closures.lisp b/closures.lisp index 09a8249..7eab991 100644 --- a/closures.lisp +++ b/closures.lisp @@ -160,7 +160,6 @@ such that the call to NEXT-FN after the match would succeed.")) (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*)) (dolist (idx containing-registers) (push nil (svref a idx)))) - (setf (car (svref *regs-maybe-start* num)) start-pos) (prog1 ;; match the inner regex and the rest of the ;; pattern; restore the original set of register From c3a7c2a0f65e9ebe0fa9c73f3df491f6deb4185a Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 15:01:36 -0500 Subject: [PATCH 089/130] Tidy up the comments in CREATE-MATCHER-AUX method specialized on REGISTER. --- closures.lisp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/closures.lisp b/closures.lisp index 7eab991..81dc7bd 100644 --- a/closures.lisp +++ b/closures.lisp @@ -87,16 +87,15 @@ such that the call to NEXT-FN after the match would succeed.")) (defmethod create-matcher-aux ((register register) next-fn) (declare #.*standard-optimize-settings*) (declare (special register-matchers subpattern-refs)) - ;; the position of this REGISTER within the whole regex; we start to - ;; count at 0 (let ((num (num register)) (containing-registers (containing-registers register)) + ;; a place to store the next function to call when we arrive + ;; here via a subpattern reference subpattern-ref-continuations) (declare (fixnum num) (list subpattern-ref-continuations)) ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which will - ;; update the corresponding values of *REG-STARTS* and *REG-ENDS* - ;; after the inner matcher has succeeded + ;; update register offsets after the inner matcher has succeded (flet ((store-end-of-reg (start-pos) (declare (fixnum start-pos) (function next-fn)) @@ -149,7 +148,7 @@ such that the call to NEXT-FN after the match would succeed.")) (declare (fixnum start-pos)) (if other-fn ;; the presence of OTHER-FN indicates that this - ;; register has been entered by a subpattern reference + ;; register has been entered via a subpattern reference ;; closure; (progn ;; create a new temporary set of register offsets for From 16278920977f6e68a17e7a15b74596f86fb8247b Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 15:10:13 -0500 Subject: [PATCH 090/130] Rename CONTAINING-REGISTERS -> SUBREGISTERS. --- closures.lisp | 18 +++++++++--------- convert.lisp | 20 ++++++++++---------- regex-class-util.lisp | 2 +- regex-class.lisp | 8 ++++---- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/closures.lisp b/closures.lisp index 81dc7bd..43d3ff4 100644 --- a/closures.lisp +++ b/closures.lisp @@ -88,7 +88,7 @@ such that the call to NEXT-FN after the match would succeed.")) (declare #.*standard-optimize-settings*) (declare (special register-matchers subpattern-refs)) (let ((num (num register)) - (containing-registers (containing-registers register)) + (subregisters (subregisters register)) ;; a place to store the next function to call when we arrive ;; here via a subpattern reference subpattern-ref-continuations) @@ -105,13 +105,13 @@ such that the call to NEXT-FN after the match would succeed.")) ;; attempt to match the rest of the pattern (let ((saved-starts (mapcar (lambda (idx) (pop (svref *reg-starts* idx))) - containing-registers)) + subregisters)) (saved-maybe-starts (mapcar (lambda (idx) (pop (svref *regs-maybe-start* idx))) - containing-registers)) + subregisters)) (saved-ends (mapcar (lambda (idx) (pop (svref *reg-ends* idx))) - containing-registers)) + subregisters)) (next-fn (pop subpattern-ref-continuations))) (prog1 (funcall (the function next-fn) start-pos) @@ -120,13 +120,13 @@ such that the call to NEXT-FN after the match would succeed.")) ;; unwound; (mapc (lambda (idx) (push (pop saved-starts) (svref *reg-starts* idx))) - containing-registers) + subregisters) (mapc (lambda (idx) (push (pop saved-maybe-starts) (svref *regs-maybe-start* idx))) - containing-registers) + subregisters) (mapc (lambda (idx) (push (pop saved-ends) (svref *reg-ends* idx))) - containing-registers) + subregisters) (push next-fn subpattern-ref-continuations))) ;; this register was not entered through a subpattern ;; reference; save the start and end positions, and @@ -157,7 +157,7 @@ such that the call to NEXT-FN after the match would succeed.")) ;; reference, as with Perl; save the old ones (push other-fn subpattern-ref-continuations) (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*)) - (dolist (idx containing-registers) + (dolist (idx subregisters) (push nil (svref a idx)))) (prog1 ;; match the inner regex and the rest of the @@ -165,7 +165,7 @@ such that the call to NEXT-FN after the match would succeed.")) ;; offsets before returning (funcall inner-matcher start-pos) (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*)) - (dolist (idx containing-registers) + (dolist (idx subregisters) (pop (svref a idx)))) (pop subpattern-ref-continuations))) (let ((old-*reg-starts* (car (svref *reg-starts* num))) diff --git a/convert.lisp b/convert.lisp index 6a8ba4d..11b5fdb 100644 --- a/convert.lisp +++ b/convert.lisp @@ -588,7 +588,7 @@ called with GREEDYP set to NIL as you would expect." when NAME is not NIL." (declare #.*standard-optimize-settings*) (declare (special flags reg-num reg-names has-subpattern-ref - accumulate-start-p containing-registers)) + accumulate-start-p subregisters)) ;; keep the effect of modifiers local to the enclosed regex; also, ;; assign the current value of REG-NUM to the corresponding slot of ;; the REGISTER object and increase this counter afterwards; for @@ -600,7 +600,7 @@ when NAME is not NIL." (setq reg-seen t) (incf (the fixnum reg-num)) (push name reg-names) - (push stored-reg-num containing-registers) + (push stored-reg-num subregisters) ;; while inside registers, we cannot indiscriminately accumulate ;; into the special variable STARTS-WITH because recursive ;; subpattern references might cause too much of the string to be @@ -613,17 +613,17 @@ when NAME is not NIL." ;; information that may be helpful in optimization (when has-subpattern-ref (setq accumulate-start-p nil)) - (let (stored-containing-registers regex) - (let (containing-registers) - (declare (special containing-registers)) + (let (stored-subregisters regex) + (let (subregisters) + (declare (special subregisters)) (setf regex (convert-aux (if name (third parse-tree) (second parse-tree))) - stored-containing-registers containing-registers)) - (setf containing-registers (append stored-containing-registers containing-registers)) + stored-subregisters subregisters)) + (setf subregisters (append stored-subregisters subregisters)) (make-instance 'register :regex regex :num stored-reg-num :name name - :containing-registers stored-containing-registers)))) + :subregisters stored-subregisters)))) (defmethod convert-compound-parse-tree ((token (eql :named-register)) parse-tree &key) "The case for \(:NAMED-REGISTER )." @@ -955,7 +955,7 @@ by subpattern references in the REGEX." (max-back-ref 0) (max-subpattern-ref 0) (has-subpattern-ref (has-subpattern-ref-p parse-tree)) - containing-registers + subregisters (converted-parse-tree (convert-aux parse-tree))) (declare (special flags reg-num reg-names @@ -966,7 +966,7 @@ by subpattern references in the REGEX." numbered-subpattern-refs named-subpattern-refs has-subpattern-ref - containing-registers)) + subregisters)) ;; make sure we don't reference registers which aren't there (when (> (the fixnum max-back-ref) (the fixnum reg-num)) diff --git a/regex-class-util.lisp b/regex-class-util.lisp index 8b55252..ca32c59 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -147,7 +147,7 @@ which are not of type STR.")) :regex (copy-regex (regex register)) :num (num register) :name (name register) - :containing-registers (containing-registers register))) + :subregisters (subregisters register))) (defmethod copy-regex ((standalone standalone)) (declare #.*standard-optimize-settings*) diff --git a/regex-class.lisp b/regex-class.lisp index 7274a2a..431ac1b 100644 --- a/regex-class.lisp +++ b/regex-class.lisp @@ -124,10 +124,10 @@ This is the index into *REGS-START* and *REGS-END*.") (name :initarg :name :reader name :documentation "Name of this register or NIL.") - (containing-registers :initarg :containing-registers - :reader containing-registers - :type list - :documentation "A list of registers (by number, zero-based) nested within this register.")) + (subregisters :initarg :subregisters + :reader subregisters + :type list + :documentation "A list of registers (by number, zero-based) nested within this register.")) (:documentation "REGISTER objects represent register groups.")) (defmethod print-object ((register register) stream) From 9d63ac7669508307c6a881026dbeabdb72253e4b Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 16 Feb 2014 15:18:35 -0500 Subject: [PATCH 091/130] Fix test 1798. It was missing the definition of regThree. --- test/perltestdata | 2 +- test/perltestinput | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/perltestdata b/test/perltestdata index 35c2e77..02fc45d 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14466,7 +14466,7 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1795 "\"ffff\" =~ /(?1)((.)\\2)/" "(?1)((.)\\2)" nil nil nil nil "ffff" nil "ffff" ("ff" "f")) (1796 "\"ffff\" =~ /(?®One)(?(?.)\\k)/" "(?®One)(?(?.)\\k)" nil nil nil nil "ffff" nil "ffff" ("ff" "f")) (1797 "\"ffffff\" =~ /(?1)((.)(?3)(\\2))/" "(?1)((.)(?3)(\\2))" nil nil nil nil "ffffff" nil nil nil) -(1798 "\"ffffff\" =~ /(?®One)(?(?.)(?®Three)(\\k))/" "(?®One)(?(?.)(?®Three)(\\k))" nil nil nil nil "ffffff" t nil nil) +(1798 "\"ffffff\" =~ /(?®One)(?(?.)(?®Three)(?\\k))/" "(?®One)(?(?.)(?®Three)(?\\k))" nil nil nil nil "ffffff" nil nil nil) (1799 "\"foffoff\" =~ /(.)(?2)((.)(?4)(\\1))/" "(.)(?2)((.)(?4)(\\1))" nil nil nil nil "foffoff" nil nil nil) (1800 "\"foffoff\" =~ /(?.)(?®Two)(?(.)(?®Four)(?\\k))/" "(?.)(?®Two)(?(.)(?®Four)(?\\k))" nil nil nil nil "foffoff" nil nil nil) (1801 "\"fffffff\" =~ /(.)(?2)((\\1)(?4)(\\1))/" "(.)(?2)((\\1)(?4)(\\1))" nil nil nil nil "fffffff" nil nil nil) diff --git a/test/perltestinput b/test/perltestinput index cabf7c8..3f58213 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4313,7 +4313,7 @@ foo)/ /(?1)((.)(?3)(\2))/ ffffff -/(?®One)(?(?.)(?®Three)(\k))/ +/(?®One)(?(?.)(?®Three)(?\k))/ ffffff /(.)(?2)((.)(?4)(\1))/ From d517e8293735fe3587bb42b9880caa5a6ede5085 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 17 Feb 2014 18:24:38 -0500 Subject: [PATCH 092/130] Remove some redundant code in CREATE-MATCHER-AUX specialized on REGISTER. The redundant code was moved into LABELS function definitions. --- closures.lisp | 94 ++++++++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 43 deletions(-) diff --git a/closures.lisp b/closures.lisp index 43d3ff4..4202a69 100644 --- a/closures.lisp +++ b/closures.lisp @@ -94,47 +94,50 @@ such that the call to NEXT-FN after the match would succeed.")) subpattern-ref-continuations) (declare (fixnum num) (list subpattern-ref-continuations)) - ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which will - ;; update register offsets after the inner matcher has succeded - (flet ((store-end-of-reg (start-pos) - (declare (fixnum start-pos) - (function next-fn)) - (if subpattern-ref-continuations - ;; this register was entered through a subpattern - ;; reference; restore the old register offsets, and - ;; attempt to match the rest of the pattern - (let ((saved-starts (mapcar (lambda (idx) - (pop (svref *reg-starts* idx))) - subregisters)) - (saved-maybe-starts (mapcar (lambda (idx) - (pop (svref *regs-maybe-start* idx))) - subregisters)) - (saved-ends (mapcar (lambda (idx) - (pop (svref *reg-ends* idx))) - subregisters)) - (next-fn (pop subpattern-ref-continuations))) - (prog1 - (funcall (the function next-fn) start-pos) - ;; push the saved register offsets back on so - ;; they can be restored when the stack is - ;; unwound; - (mapc (lambda (idx) - (push (pop saved-starts) (svref *reg-starts* idx))) - subregisters) - (mapc (lambda (idx) - (push (pop saved-maybe-starts) (svref *regs-maybe-start* idx))) - subregisters) - (mapc (lambda (idx) - (push (pop saved-ends) (svref *reg-ends* idx))) - subregisters) - (push next-fn subpattern-ref-continuations))) - ;; this register was not entered through a subpattern - ;; reference; save the start and end positions, and - ;; match the rest of the pattern - (progn - (setf (car (svref *reg-starts* num)) (car (svref *regs-maybe-start* num)) - (car (svref *reg-ends* num)) start-pos) - (funcall next-fn start-pos))))) + (labels + ((pop-offsets (offsets) + (declare (simple-vector offsets)) + ;; FIXME: would LOOP be faster? + (mapcar (lambda (idx) + (declare (fixnum idx)) + (pop (svref offsets idx))) + subregisters)) + (push-offsets (offsets saved-offsets) + (declare (simple-vector offsets) (list saved-offsets)) + ;; FIXME: would LOOP be faster? + (mapc (lambda (idx) + (declare (fixnum idx)) + (push (pop saved-offsets) (svref offsets idx))) + subregisters)) + ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which + ;; will update register offsets after the inner matcher has + ;; succeded + (store-end-of-reg (start-pos) + (declare (fixnum start-pos) + (function next-fn)) + (if subpattern-ref-continuations + ;; this register was entered through a subpattern + ;; reference; restore the old register offsets, and + ;; attempt to match the rest of the pattern + (let ((saved-starts (pop-offsets *reg-starts*)) + (saved-maybe-starts (pop-offsets *regs-maybe-start*)) + (saved-ends (pop-offsets *reg-ends*)) + (next-fn (pop subpattern-ref-continuations))) + (prog1 + (funcall (the function next-fn) start-pos) + ;; push the saved register offsets back on so they + ;; can be restored when the stack is unwound + (push-offsets *reg-starts* saved-starts) + (push-offsets *regs-maybe-start* saved-maybe-starts) + (push-offsets *reg-ends* saved-ends) + (push next-fn subpattern-ref-continuations))) + ;; this register was not entered through a subpattern + ;; reference; save the start and end positions, and + ;; match the rest of the pattern + (progn + (setf (car (svref *reg-starts* num)) (car (svref *regs-maybe-start* num)) + (car (svref *reg-ends* num)) start-pos) + (funcall next-fn start-pos))))) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER (let ((inner-matcher (create-matcher-aux (regex register) @@ -158,15 +161,20 @@ such that the call to NEXT-FN after the match would succeed.")) (push other-fn subpattern-ref-continuations) (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*)) (dolist (idx subregisters) - (push nil (svref a idx)))) + ;; don't use PUSH-OFFSETS here, since we don't + ;; need to do two assignments every time through + ;; the loop + (push nil (svref (the simple-vector a) (the fixnum idx))))) (prog1 ;; match the inner regex and the rest of the ;; pattern; restore the original set of register ;; offsets before returning (funcall inner-matcher start-pos) (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*)) + ;; don't use POP-OFFSETS here, since we don't + ;; need to accumulate the values into a list (dolist (idx subregisters) - (pop (svref a idx)))) + (pop (svref (the simple-vector a) (the fixnum idx))))) (pop subpattern-ref-continuations))) (let ((old-*reg-starts* (car (svref *reg-starts* num))) (old-*regs-maybe-start* (car (svref *regs-maybe-start* num))) From bfe5c9293c9a6b7e61b74e02a0262fbbf6ad24e3 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Mon, 17 Feb 2014 21:23:07 -0500 Subject: [PATCH 093/130] Inline POP-OFFSETS and PUSH-OFFSETS. --- closures.lisp | 1 + 1 file changed, 1 insertion(+) diff --git a/closures.lisp b/closures.lisp index 4202a69..9fd1506 100644 --- a/closures.lisp +++ b/closures.lisp @@ -138,6 +138,7 @@ such that the call to NEXT-FN after the match would succeed.")) (setf (car (svref *reg-starts* num)) (car (svref *regs-maybe-start* num)) (car (svref *reg-ends* num)) start-pos) (funcall next-fn start-pos))))) + (declare (inline pop-offsets push-offsets)) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER (let ((inner-matcher (create-matcher-aux (regex register) From eb26c384c9440ef386965fcd7d61d245ce9c41cb Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 18 Feb 2014 17:43:35 -0500 Subject: [PATCH 094/130] Use LOOP instead of MAPCAR/MAPC for pushing/popping register offsets. --- closures.lisp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/closures.lisp b/closures.lisp index 9fd1506..5b99bb4 100644 --- a/closures.lisp +++ b/closures.lisp @@ -97,18 +97,12 @@ such that the call to NEXT-FN after the match would succeed.")) (labels ((pop-offsets (offsets) (declare (simple-vector offsets)) - ;; FIXME: would LOOP be faster? - (mapcar (lambda (idx) - (declare (fixnum idx)) - (pop (svref offsets idx))) - subregisters)) + (loop for idx in subregisters + collect (pop (svref offsets (the fixnum idx))))) (push-offsets (offsets saved-offsets) (declare (simple-vector offsets) (list saved-offsets)) - ;; FIXME: would LOOP be faster? - (mapc (lambda (idx) - (declare (fixnum idx)) - (push (pop saved-offsets) (svref offsets idx))) - subregisters)) + (loop for idx in subregisters do + (push (pop saved-offsets) (svref offsets (the fixnum idx))))) ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which ;; will update register offsets after the inner matcher has ;; succeded From 1da422da2163a4a72f62e5b1e5ee9edc865c1eeb Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 18 Feb 2014 18:52:35 -0500 Subject: [PATCH 095/130] Disable some tests in test/perltestdata, but add them to test/simple. These are tests that even Perl gets wrong. --- test/perl-tests.lisp | 2 +- test/simple | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/test/perl-tests.lisp b/test/perl-tests.lisp index 5695c75..a114589 100644 --- a/test/perl-tests.lisp +++ b/test/perl-tests.lisp @@ -34,7 +34,7 @@ (in-package :cl-ppcre-test) -(defvar *tests-to-skip* '(636 638 662 790 1439) +(defvar *tests-to-skip* '(636 638 662 790 1439 1787 1788 1797 1798 1799 1800 1801 1802) "Some tests we skip because the testdata is generated by a Perl program and CL-PPCRE differs from Perl for these tests - on purpose.") diff --git a/test/simple b/test/simple index 479b16b..ff6f8da 100644 --- a/test/simple +++ b/test/simple @@ -374,3 +374,45 @@ characters if there's a match." (:subpattern-reference "reg"))) "foo")) '(0 3 #(1) #(2))) + +;; The next eight tests correspond to tests 1787, 1788, and 1797-1802 in +;; perltestdata. We reproduce them here because Perl itself gets these wrong. +(equalp (multiple-value-list + (scan "(.)(((?5))(\\1))((?4))" "ffff")) + '(0 4 #(0 1 1 2 3) #(1 3 2 3 4))) + +(let ((*allow-named-registers* t) + (regex "(?.)(((?®Five))(?\\k))(?(?®Four))")) + (equalp (multiple-value-list + (scan regex "ffff")) + '(0 4 #(0 1 1 2 3) #(1 3 2 3 4)))) + +(equalp (multiple-value-list + (scan "(?1)((.)(?3)(\\2))" "ffffff")) + '(0 6 #(3 3 5) #(6 4 6))) + +(let ((*allow-named-registers* t) + (regex "(?®One)(?(?.)(?®Three)(?\\k))")) + (equalp (multiple-value-list + (scan regex "ffffff")) + '(0 6 #(3 3 5) #(6 4 6)))) + +(equalp (multiple-value-list + (scan "(.)(?2)((.)(?4)(\\1))" "foffoff")) + '(0 7 #(0 4 4 6) #(1 7 5 7))) + +(let ((*allow-named-registers* t) + (regex "(?.)(?®Two)(?(.)(?®Four)(?\\k))")) + (equalp (multiple-value-list + (scan regex "foffoff")) + '(0 7 #(0 4 4 6) #(1 7 5 7)))) + +(equalp (multiple-value-list + (scan "(.)(?2)((\\1)(?4)(\\1))" "fffffff")) + '(0 7 #(0 4 4 6) #(1 7 5 7))) + +(let ((*allow-named-registers* t) + (regex "(?.)(?®Two)(?(\\k)(?®Four)(?\\k))")) + (equalp (multiple-value-list + (scan regex "fffffff")) + '(0 7 #(0 4 4 6) #(1 7 5 7)))) From 0b1b87ec7359d48f5ca9df342af114e60ed1cb35 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Tue, 18 Feb 2014 20:38:39 -0500 Subject: [PATCH 096/130] Record SUBREGISTER-COUNT instead of a list of SUBREGISTERS. The numbers of registers nested within a register must be contiguous with each other and with that of the parent register, so there's no need to compute a list of subregisters--we just need to know how many are nested within, and we can compute the rest therefrom. --- closures.lisp | 24 ++++++++++++------------ convert.lisp | 25 ++++++++----------------- regex-class-util.lisp | 2 +- regex-class.lisp | 8 ++++---- 4 files changed, 25 insertions(+), 34 deletions(-) diff --git a/closures.lisp b/closures.lisp index 5b99bb4..3e8c4a6 100644 --- a/closures.lisp +++ b/closures.lisp @@ -88,20 +88,20 @@ such that the call to NEXT-FN after the match would succeed.")) (declare #.*standard-optimize-settings*) (declare (special register-matchers subpattern-refs)) (let ((num (num register)) - (subregisters (subregisters register)) + (subregister-count (subregister-count register)) ;; a place to store the next function to call when we arrive ;; here via a subpattern reference subpattern-ref-continuations) - (declare (fixnum num) + (declare (fixnum num subregister-count) (list subpattern-ref-continuations)) (labels ((pop-offsets (offsets) (declare (simple-vector offsets)) - (loop for idx in subregisters + (loop for idx from (1+ num) upto (+ num subregister-count) collect (pop (svref offsets (the fixnum idx))))) (push-offsets (offsets saved-offsets) (declare (simple-vector offsets) (list saved-offsets)) - (loop for idx in subregisters do + (loop for idx from (1+ num) upto (+ num subregister-count) do (push (pop saved-offsets) (svref offsets (the fixnum idx))))) ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which ;; will update register offsets after the inner matcher has @@ -155,11 +155,11 @@ such that the call to NEXT-FN after the match would succeed.")) ;; reference, as with Perl; save the old ones (push other-fn subpattern-ref-continuations) (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*)) - (dolist (idx subregisters) - ;; don't use PUSH-OFFSETS here, since we don't - ;; need to do two assignments every time through - ;; the loop - (push nil (svref (the simple-vector a) (the fixnum idx))))) + ;; don't use PUSH-OFFSETS here, since we don't need + ;; to do two assignments every time through the + ;; loop + (loop for idx from (1+ num) upto (+ num subregister-count) do + (push nil (svref (the simple-vector a) (the fixnum idx))))) (prog1 ;; match the inner regex and the rest of the ;; pattern; restore the original set of register @@ -167,9 +167,9 @@ such that the call to NEXT-FN after the match would succeed.")) (funcall inner-matcher start-pos) (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*)) ;; don't use POP-OFFSETS here, since we don't - ;; need to accumulate the values into a list - (dolist (idx subregisters) - (pop (svref (the simple-vector a) (the fixnum idx))))) + ;; need to collect the POPped values + (loop for idx from (1+ num) upto (+ num subregister-count) do + (pop (svref (the simple-vector a) (the fixnum idx))))) (pop subpattern-ref-continuations))) (let ((old-*reg-starts* (car (svref *reg-starts* num))) (old-*regs-maybe-start* (car (svref *regs-maybe-start* num))) diff --git a/convert.lisp b/convert.lisp index 11b5fdb..c386116 100644 --- a/convert.lisp +++ b/convert.lisp @@ -587,8 +587,7 @@ called with GREEDYP set to NIL as you would expect." "The case for \(:REGISTER ). Also used for named registers when NAME is not NIL." (declare #.*standard-optimize-settings*) - (declare (special flags reg-num reg-names has-subpattern-ref - accumulate-start-p subregisters)) + (declare (special flags reg-num reg-names has-subpattern-ref accumulate-start-p)) ;; keep the effect of modifiers local to the enclosed regex; also, ;; assign the current value of REG-NUM to the corresponding slot of ;; the REGISTER object and increase this counter afterwards; for @@ -597,10 +596,10 @@ when NAME is not NIL." (let ((flags (copy-list flags)) (stored-reg-num reg-num)) (declare (special flags reg-seen)) + (declare (fixnum stored-reg-num)) (setq reg-seen t) (incf (the fixnum reg-num)) (push name reg-names) - (push stored-reg-num subregisters) ;; while inside registers, we cannot indiscriminately accumulate ;; into the special variable STARTS-WITH because recursive ;; subpattern references might cause too much of the string to be @@ -613,17 +612,11 @@ when NAME is not NIL." ;; information that may be helpful in optimization (when has-subpattern-ref (setq accumulate-start-p nil)) - (let (stored-subregisters regex) - (let (subregisters) - (declare (special subregisters)) - (setf regex (convert-aux (if name (third parse-tree) (second parse-tree))) - stored-subregisters subregisters)) - (setf subregisters (append stored-subregisters subregisters)) - (make-instance 'register - :regex regex - :num stored-reg-num - :name name - :subregisters stored-subregisters)))) + (make-instance 'register + :regex (convert-aux (if name (third parse-tree) (second parse-tree))) + :num stored-reg-num + :name name + :subregister-count (- (the fixnum reg-num) stored-reg-num 1)))) (defmethod convert-compound-parse-tree ((token (eql :named-register)) parse-tree &key) "The case for \(:NAMED-REGISTER )." @@ -955,7 +948,6 @@ by subpattern references in the REGEX." (max-back-ref 0) (max-subpattern-ref 0) (has-subpattern-ref (has-subpattern-ref-p parse-tree)) - subregisters (converted-parse-tree (convert-aux parse-tree))) (declare (special flags reg-num reg-names @@ -965,8 +957,7 @@ by subpattern references in the REGEX." max-subpattern-ref numbered-subpattern-refs named-subpattern-refs - has-subpattern-ref - subregisters)) + has-subpattern-ref)) ;; make sure we don't reference registers which aren't there (when (> (the fixnum max-back-ref) (the fixnum reg-num)) diff --git a/regex-class-util.lisp b/regex-class-util.lisp index ca32c59..cea9d58 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -147,7 +147,7 @@ which are not of type STR.")) :regex (copy-regex (regex register)) :num (num register) :name (name register) - :subregisters (subregisters register))) + :subregister-count (subregister-count register))) (defmethod copy-regex ((standalone standalone)) (declare #.*standard-optimize-settings*) diff --git a/regex-class.lisp b/regex-class.lisp index 431ac1b..cddc75f 100644 --- a/regex-class.lisp +++ b/regex-class.lisp @@ -124,10 +124,10 @@ This is the index into *REGS-START* and *REGS-END*.") (name :initarg :name :reader name :documentation "Name of this register or NIL.") - (subregisters :initarg :subregisters - :reader subregisters - :type list - :documentation "A list of registers (by number, zero-based) nested within this register.")) + (subregister-count :initarg :subregister-count + :reader subregister-count + :type fixnum + :documentation "The number of registers nested within this register.")) (:documentation "REGISTER objects represent register groups.")) (defmethod print-object ((register register) stream) From 8db37a9297cf69570ef49d9357814e2ae98dc963 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 20 Feb 2014 20:40:37 -0500 Subject: [PATCH 097/130] Add two more tests that currently fail. Each fails for a different reason. The first fails because it matches where Perl does not. (It's not clear whose bug this is.) The second fails because we're not waiting until the regex has finished compiling before validating register names. --- test/perltestdata | 2 ++ test/perltestinput | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/test/perltestdata b/test/perltestdata index 02fc45d..9dd58cc 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14477,3 +14477,5 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1806 "\"a\" =~ /(?a(?®One)?)/" "(?a(?®One)?)" nil nil nil nil "a" nil "a" ("a")) (1807 "\"aa\" =~ /(?a(?®One)?)/" "(?a(?®One)?)" nil nil nil nil "aa" nil "aa" ("aa")) (1808 "\"aaa\" =~ /(?a(?®One)?)/" "(?a(?®One)?)" nil nil nil nil "aaa" nil "aaa" ("aaa")) +(1809 "\"abcb\" =~ /^(.\\2?)(.)(?1)$/" "^(.\\2?)(.)(?1)$" nil nil nil nil "abcb" nil nil nil) +(1810 "\"abcb\" =~ /^(?.\\k?)(?.)(?®One)$/" "^(?.\\k?)(?.)(?®One)$" nil nil nil nil "abcb" nil nil nil) diff --git a/test/perltestinput b/test/perltestinput index 3f58213..01dff13 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4337,3 +4337,9 @@ foo)/ a aa aaa + +/^(.\2?)(.)(?1)$/ + abcb + +/^(?.\k?)(?.)(?®One)$/ + abcb From f08f4e2bc9cb31a5bf8bcd224cd880d1045c03fa Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 20 Feb 2014 20:50:25 -0500 Subject: [PATCH 098/130] Add two more tests that fail. These are like the previous two tests added in the previous commit, except they deal with "self-referential" backreferences rather than forward backreferences. --- test/perltestdata | 6 ++++-- test/perltestinput | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/perltestdata b/test/perltestdata index 9dd58cc..1f3480c 100644 --- a/test/perltestdata +++ b/test/perltestdata @@ -14477,5 +14477,7 @@ foo)" nil nil nil nil "foofoo" t nil nil) (1806 "\"a\" =~ /(?a(?®One)?)/" "(?a(?®One)?)" nil nil nil nil "a" nil "a" ("a")) (1807 "\"aa\" =~ /(?a(?®One)?)/" "(?a(?®One)?)" nil nil nil nil "aa" nil "aa" ("aa")) (1808 "\"aaa\" =~ /(?a(?®One)?)/" "(?a(?®One)?)" nil nil nil nil "aaa" nil "aaa" ("aaa")) -(1809 "\"abcb\" =~ /^(.\\2?)(.)(?1)$/" "^(.\\2?)(.)(?1)$" nil nil nil nil "abcb" nil nil nil) -(1810 "\"abcb\" =~ /^(?.\\k?)(?.)(?®One)$/" "^(?.\\k?)(?.)(?®One)$" nil nil nil nil "abcb" nil nil nil) +(1809 "\"aba\" =~ /^(.\\1?)(?1)$/" "^(.\\1?)(?1)$" nil nil nil nil "aba" nil nil nil) +(1810 "\"aba\" =~ /^(?.\\k?)(?®One)$/" "^(?.\\k?)(?®One)$" nil nil nil nil "aba" nil nil nil) +(1811 "\"abcb\" =~ /^(.\\2?)(.)(?1)$/" "^(.\\2?)(.)(?1)$" nil nil nil nil "abcb" nil nil nil) +(1812 "\"abcb\" =~ /^(?.\\k?)(?.)(?®One)$/" "^(?.\\k?)(?.)(?®One)$" nil nil nil nil "abcb" nil nil nil) diff --git a/test/perltestinput b/test/perltestinput index 01dff13..fbe9ead 100644 --- a/test/perltestinput +++ b/test/perltestinput @@ -4338,6 +4338,12 @@ foo)/ aa aaa +/^(.\1?)(?1)$/ + aba + +/^(?.\k?)(?®One)$/ + aba + /^(.\2?)(.)(?1)$/ abcb From f064a0c57ceddca921770022efcb67c8bf61aacb Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 20 Feb 2014 20:59:11 -0500 Subject: [PATCH 099/130] Document subpattern references in the html documentation. --- doc/index.html | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/index.html b/doc/index.html index 35896f2..083f293 100644 --- a/doc/index.html +++ b/doc/index.html @@ -214,8 +214,9 @@

Scanning

in man perlre including extended features like non-greedy repetitions, positive and negative look-ahead and look-behind -assertions, "standalone" subexpressions, and conditional -subpatterns. The following Perl features are (currently) not +assertions, "standalone" subexpressions, conditional +subpatterns, and subpattern references, including recursive +references. The following Perl features are (currently) not supported:
    @@ -258,6 +259,12 @@

    Scanning

    braces is supported, i.e. \p{Letter} and \p{L} will work while \pL won't.

    +Since version 2.1.0, CL-PPCRE supports subpattern references, which +allow for easy matching of self-similar or recursive patterns. To +refer to a subpattern, use (?N), where N is +the register's number; or (?&NAME), +where NAME is the register's name. +

    The keyword arguments are just for your convenience. You can always use embedded modifiers like "(?i-s)" instead. @@ -406,6 +413,16 @@

    Scanning

    href="#*allow-named-registers*">*ALLOW-NAMED-REGISTERS* for more information. +
  • (:SUBPATTERN-REFERENCE <ref>) is a +subpattern reference. <ref> is a positive +integer denoting a register number or a string denoting its name. +Unlike back-references, a subpattern reference matches +the pattern contained within the register, not the text matched +by it. Also unlike back-references, subpattern references can +meaningfully refer forward to later registers and, more importantly, +to containing registers, which allows for easy matching of recursive +or self-similar strings. +
  • (:PROPERTY|:INVERTED-PROPERTY <property>) is a named property (or its inverse) with <property> being a function designator or a From 0de65d3cac67f5bed71d49f1ce1f5ba2ba88e6a4 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 20 Feb 2014 21:11:48 -0500 Subject: [PATCH 100/130] Add subpattern reference commentary to docs on *ALLOW-NAMED-REGISTERS* Also, add some FIXME comments to return to later. --- doc/index.html | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/doc/index.html b/doc/index.html index 083f293..838b299 100644 --- a/doc/index.html +++ b/doc/index.html @@ -262,8 +262,8 @@

    Scanning

    Since version 2.1.0, CL-PPCRE supports subpattern references, which allow for easy matching of self-similar or recursive patterns. To refer to a subpattern, use (?N), where N is -the register's number; or (?&NAME), -where NAME is the register's name. +the register's number; or (?&name), +where name is the register's name.

    The keyword arguments are just for your convenience. You can always use embedded modifiers like @@ -415,13 +415,13 @@

    Scanning

  • (:SUBPATTERN-REFERENCE <ref>) is a subpattern reference. <ref> is a positive -integer denoting a register number or a string denoting its name. -Unlike back-references, a subpattern reference matches -the pattern contained within the register, not the text matched -by it. Also unlike back-references, subpattern references can -meaningfully refer forward to later registers and, more importantly, -to containing registers, which allows for easy matching of recursive -or self-similar strings. +integer denoting a register number or a string denoting its name. Unlike back-references, a subpattern +reference matches the pattern contained within the register, +not the text matched by it. Also unlike back-references, subpattern +references can meaningfully refer forward to later registers and, more +importantly, to containing registers, which allows for easy matching +of recursive or self-similar strings.
  • (:PROPERTY|:INVERTED-PROPERTY <property>) is a named property (or its inverse) with @@ -1320,9 +1320,20 @@

    Modifying scanner behaviour


    If this value is true (the default is NIL), -CL-PPCRE will support (?<name>"<regex>") and \k<name> in regex -strings to provide named registers and back-references as in AllegroCL. name is has to start with a letter and can contain only alphanumeric characters or minus sign. Names of registers are matched case-sensitively. -The parse tree syntax is not affected by the *ALLOW-NAMED-REGISTERS* switch, :NAMED-REGISTER and :BACK-REFERENCE forms are always resolved as expected. There are also no restrictions on register names in this syntax except that they have to be strings. +CL-PPCRE will support (?<name>"<regex>"), +\k<name>, and (?&name) in regex +strings to provide named registers, back-references, and subpattern references. +name has to start with a letter and can contain +only alphanumeric characters or minus sign. Names of registers are +matched case-sensitively. +The parse tree +syntax is not affected by the *ALLOW-NAMED-REGISTERS* +switch: :NAMED-REGISTER, :BACK-REFERENCE, +and :SUBPATTERN-REFERENCE forms are always resolved as +expected. There are also no restrictions on register names in this +syntax except that they have to be strings.
     ;; Perl compatible mode (*ALLOW-NAMED-REGISTERS* is NIL)
    
    From adb91565c6f67ba4a8039b171251ab2a20ecb409 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 18:07:04 -0500
    Subject: [PATCH 101/130] Restore the original docstrings to *REG-STARTS*, etc.
    
    This begins a third attempt at a register offsets storage model.
    
    The problem with the current model is that it changed the
    implementation of *REG-STARTS*, etc., variables that I didn't realize
    were part of the api.  This latest attempt will restore the original
    semantics to those variables and store offset stacks (for recursive
    subpattern references) in separate variables.
    ---
     specials.lisp | 11 ++++++-----
     1 file changed, 6 insertions(+), 5 deletions(-)
    
    diff --git a/specials.lisp b/specials.lisp
    index d4ad45f..547a1ab 100644
    --- a/specials.lisp
    +++ b/specials.lisp
    @@ -83,17 +83,18 @@ Will always be coerced to a SIMPLE-STRING.")
     (declaim (fixnum *end-pos*))
     
     (defvar *reg-starts* (make-array 0)
    -  "An array holding lists where the car of each list is the offset of
    -the start position of the register numbered by that index.")
    +  "An array which holds the start positions
    +of the current register candidates.")
     (declaim (simple-vector *reg-starts*))
       
     (defvar *regs-maybe-start* (make-array 0)
    -  "Same as *REG-STARTS*, except these values may be spurious.")
    +  "An array which holds the next start positions
    +of the current register candidates.")
     (declaim (simple-vector *regs-maybe-start*))
     
     (defvar *reg-ends* (make-array 0)
    -  "An array holding lists where the car of each list is the offset of
    -the end position of the register numbered by that index.")
    +  "An array which holds the end positions
    +of the current register candidates.")
     (declaim (simple-vector *reg-ends*))
     
     (defvar *end-string-pos* nil
    
    From 07c8d929377b7cadccbcdeacf472276fae064324 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 18:19:07 -0500
    Subject: [PATCH 102/130] Add three new special variables for holding the
     register offsets stacks.
    
    ---
     specials.lisp | 15 +++++++++++++++
     1 file changed, 15 insertions(+)
    
    diff --git a/specials.lisp b/specials.lisp
    index 547a1ab..3da36bf 100644
    --- a/specials.lisp
    +++ b/specials.lisp
    @@ -86,17 +86,32 @@ Will always be coerced to a SIMPLE-STRING.")
       "An array which holds the start positions
     of the current register candidates.")
     (declaim (simple-vector *reg-starts*))
    +
    +(defvar *reg-starts-stacks* (make-array 0)
    +  "A book-keeping array holding stacks of register start positions for saving
    +and restoring them upon entering and exiting subpattern references.")
    +(declaim (simple-vector *reg-starts-stacks*))
       
     (defvar *regs-maybe-start* (make-array 0)
       "An array which holds the next start positions
     of the current register candidates.")
     (declaim (simple-vector *regs-maybe-start*))
     
    +(defvar *regs-maybe-start-stacks* (make-array 0)
    +  "A book-keeping array holding stacks of tentative register start positions for
    +saving and restoring them upon entering and exiting subpattern references.")
    +(declaim (simple-vector *regs-maybe-start-stacks*))
    +
     (defvar *reg-ends* (make-array 0)
       "An array which holds the end positions
     of the current register candidates.")
     (declaim (simple-vector *reg-ends*))
     
    +(defvar *reg-ends-stacks* (make-array 0)
    +  "A book-keeping array holding stacks of register end positions for saving and
    +restoring them upon entering and exiting subpattern references.")
    +(declaim (simple-vector *reg-ends-stacks*))
    +
     (defvar *end-string-pos* nil
       "Start of the next possible end-string candidate.")
     
    
    From b1d2ec7d0f8c6c8af946a92bda032446c2e1a409 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 18:27:49 -0500
    Subject: [PATCH 103/130] Bind new special variables when scanning.
    
    ---
     scanner.lisp | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/scanner.lisp b/scanner.lisp
    index 2ac63dd..2a99c4a 100644
    --- a/scanner.lisp
    +++ b/scanner.lisp
    @@ -148,8 +148,11 @@ ADVANCE-FN.  This is a utility macro used by CREATE-SCANNER-AUX."
                   (*repeat-counters* *repeat-counters*)
                   (*last-pos-stores* *last-pos-stores*)
                   (*reg-starts* *reg-starts*)
    +              (*reg-starts-stacks* *reg-starts-stacks*)
                   (*regs-maybe-start* *regs-maybe-start*)
    +              (*regs-maybe-start-stacks* *regs-maybe-start-stacks*)
                   (*reg-ends* *reg-ends*)
    +              (*reg-ends-stacks* *reg-ends-stacks*)
                   ;; we might be able to optimize the scanning process by
                   ;; (virtually) shifting *START-POS* to the right
                   (scan-start-pos *start-pos*)
    
    From ad4d39f5409816f8fc6cb6eef79b1fae63bb4c58 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 18:59:51 -0500
    Subject: [PATCH 104/130] Make *REG-STARTS*, etc., have NIL as initial value
     instead of (list nil).
    
    ---
     scanner.lisp | 22 +++++++++++++---------
     1 file changed, 13 insertions(+), 9 deletions(-)
    
    diff --git a/scanner.lisp b/scanner.lisp
    index 2a99c4a..2c1747d 100644
    --- a/scanner.lisp
    +++ b/scanner.lisp
    @@ -162,6 +162,7 @@ ADVANCE-FN.  This is a utility macro used by CREATE-SCANNER-AUX."
                   ;; we don't need to try further than MAX-END-POS
                   (max-end-pos (- *end-pos* min-len)))
              (declare (fixnum scan-start-pos) (function match-fn))
    +         (declare (special subpattern-refs))
              ;; definition of ADVANCE-FN will be inserted here by macrology
              (labels ((advance-fn-definition))
                (declare (inline advance-fn))
    @@ -177,11 +178,14 @@ ADVANCE-FN.  This is a utility macro used by CREATE-SCANNER-AUX."
                  (setq *last-pos-stores* (make-array zero-length-num
                                                      :initial-element nil)))
                (when (plusp reg-num)
    -             (flet ((list-nil () (list nil)))
    -               ;; we have registers in our regular expression
    -               (setq *reg-starts* (map-into (make-array reg-num) #'list-nil)
    -                     *regs-maybe-start* (map-into (make-array reg-num) #'list-nil)
    -                     *reg-ends* (map-into (make-array reg-num) #'list-nil))))
    +             (setq *reg-starts* (make-array reg-num :initial-element nil)
    +                   *regs-maybe-start* (make-array reg-num :initial-element nil)
    +                   *reg-ends* (make-array reg-num :initial-element nil))
    +             (when subpattern-refs
    +               ;; we have subpattern references
    +               (setq *reg-starts-stacks* (make-array reg-num :initial-element nil)
    +                     *regs-maybe-start-stacks* (make-array reg-num :initial-element nil)
    +                     *reg-ends-stacks* (make-array reg-num :initial-element nil))))
                (when end-anchored-p
                  ;; the regular expression has a constant end string which
                  ;; is anchored at the very end of the target string
    @@ -286,8 +290,8 @@ ADVANCE-FN.  This is a utility macro used by CREATE-SCANNER-AUX."
                        (when next-pos
                          (values (if next-pos *start-pos* nil)
                                  next-pos
    -                             (map-into *reg-starts* #'car *reg-starts*)
    -                             (map-into *reg-ends* #'car *reg-ends*)))))
    +                             *reg-starts*
    +                             *reg-ends*))))
                    (t
                      (loop for pos = (if starts-with-everything
                                        ;; don't jump to the next
    @@ -304,8 +308,8 @@ ADVANCE-FN.  This is a utility macro used by CREATE-SCANNER-AUX."
                                 (when next-pos
                                   (return-from scan (values pos
                                                             next-pos
    -                                                        (map-into *reg-starts* #'car *reg-starts*)
    -                                                        (map-into *reg-ends* #'car *reg-ends*))))
    +                                                        *reg-starts*
    +                                                        *reg-ends*)))
                                 ;; not yet found, increment POS
                                 #-cormanlisp (incf (the fixnum pos))
                                 #+cormanlisp (incf pos)))))))))
    
    From 00c2ca5914e443db6a56565a6c917cb75a28f642 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 19:02:45 -0500
    Subject: [PATCH 105/130] Access offset values directly in *REG-STARTS*, etc.,
     instead of thorugh CAR.
    
    ---
     closures.lisp | 10 +++++-----
     1 file changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/closures.lisp b/closures.lisp
    index 3e8c4a6..b3cb287 100644
    --- a/closures.lisp
    +++ b/closures.lisp
    @@ -459,8 +459,8 @@ against CHR-EXPR."
           ;; the case-insensitive version
           (lambda (start-pos)
             (declare (fixnum start-pos))
    -        (let ((reg-start (car (svref *reg-starts* num)))
    -              (reg-end (car (svref *reg-ends* num))))
    +        (let ((reg-start (svref *reg-starts* num))
    +              (reg-end (svref *reg-ends* num)))
               ;; only bother to check if the corresponding REGISTER as
               ;; matched successfully already
               (and reg-start
    @@ -475,8 +475,8 @@ against CHR-EXPR."
           ;; the case-sensitive version
           (lambda (start-pos)
             (declare (fixnum start-pos))
    -        (let ((reg-start (car (svref *reg-starts* num)))
    -              (reg-end (car (svref *reg-ends* num))))
    +        (let ((reg-start (svref *reg-starts* num))
    +              (reg-end (svref *reg-ends* num)))
               ;; only bother to check if the corresponding REGISTER as
               ;; matched successfully already
               (and reg-start
    @@ -512,7 +512,7 @@ against CHR-EXPR."
                 (lambda (start-pos)
                   (declare (fixnum test))
                   (if (and (< test (length *reg-starts*))
    -                       (car (svref *reg-starts* test)))
    +                       (svref *reg-starts* test))
                     (funcall then-matcher start-pos)
                     (funcall else-matcher start-pos))))
               (t
    
    From e64e5ba95a1c7d9f1185cbcbabc00a7d4a8bbc47 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 19:31:09 -0500
    Subject: [PATCH 106/130] Finish implementing the newest register offsets
     storage model.
    
    ---
     closures.lisp | 61 ++++++++++++++++++++++++---------------------------
     1 file changed, 29 insertions(+), 32 deletions(-)
    
    diff --git a/closures.lisp b/closures.lisp
    index b3cb287..dd4b2c7 100644
    --- a/closures.lisp
    +++ b/closures.lisp
    @@ -95,14 +95,16 @@ such that the call to NEXT-FN after the match would succeed."))
         (declare (fixnum num subregister-count)
                  (list subpattern-ref-continuations))
         (labels
    -        ((pop-offsets (offsets)
    -           (declare (simple-vector offsets))
    +        ((pop-offsets (offsets offsets-stacks)
    +           (declare (simple-vector offsets offsets-stacks))
                (loop for idx from (1+ num) upto (+ num subregister-count)
    -                collect (pop (svref offsets (the fixnum idx)))))
    -         (push-offsets (offsets saved-offsets)
    -           (declare (simple-vector offsets) (list saved-offsets))
    +                collect (setf (svref offsets (the fixnum idx))
    +                              (pop (svref offsets-stacks (the fixnum idx))))))
    +         (push-offsets (offsets saved-offsets offsets-stacks)
    +           (declare (simple-vector offsets offsets-stacks) (list saved-offsets))
                (loop for idx from (1+ num) upto (+ num subregister-count) do
    -                (push (pop saved-offsets) (svref offsets (the fixnum idx)))))
    +                (push (svref offsets (the fixnum idx)) (svref offsets-stacks (the fixnum idx)))
    +                (setf (svref offsets (the fixnum idx)) (pop saved-offsets))))
              ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which
              ;; will update register offsets after the inner matcher has
              ;; succeded
    @@ -113,24 +115,24 @@ such that the call to NEXT-FN after the match would succeed."))
                    ;; this register was entered through a subpattern
                    ;; reference; restore the old register offsets, and
                    ;; attempt to match the rest of the pattern
    -               (let ((saved-starts (pop-offsets *reg-starts*))
    -                     (saved-maybe-starts (pop-offsets *regs-maybe-start*))
    -                     (saved-ends (pop-offsets *reg-ends*))
    +               (let ((saved-starts (pop-offsets *reg-starts* *reg-starts-stacks*))
    +                     (saved-maybe-starts (pop-offsets *regs-maybe-start* *regs-maybe-start-stacks*))
    +                     (saved-ends (pop-offsets *reg-ends* *reg-ends-stacks*))
                          (next-fn (pop subpattern-ref-continuations)))
                      (prog1
                          (funcall (the function next-fn) start-pos)
                        ;; push the saved register offsets back on so they
                        ;; can be restored when the stack is unwound
    -                   (push-offsets *reg-starts* saved-starts)
    -                   (push-offsets *regs-maybe-start* saved-maybe-starts)
    -                   (push-offsets *reg-ends* saved-ends)
    +                   (push-offsets *reg-starts* saved-starts *reg-starts-stacks*)
    +                   (push-offsets *regs-maybe-start* saved-maybe-starts *regs-maybe-start-stacks*)
    +                   (push-offsets *reg-ends* saved-ends *reg-ends-stacks*)
                        (push next-fn subpattern-ref-continuations)))
                    ;; this register was not entered through a subpattern
                    ;; reference; save the start and end positions, and
                    ;; match the rest of the pattern
                    (progn
    -                 (setf (car (svref *reg-starts* num)) (car (svref *regs-maybe-start* num))
    -                       (car (svref *reg-ends* num)) start-pos)
    +                 (setf (svref *reg-starts* num) (svref *regs-maybe-start* num)
    +                       (svref *reg-ends* num) start-pos)
                      (funcall next-fn start-pos)))))
           (declare (inline pop-offsets push-offsets))
           ;; the inner matcher is a closure corresponding to the regex
    @@ -154,35 +156,30 @@ such that the call to NEXT-FN after the match would succeed."))
                      ;; to match back references while inside a subpattern
                      ;; reference, as with Perl; save the old ones
                      (push other-fn subpattern-ref-continuations)
    -                 (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*))
    -                   ;; don't use PUSH-OFFSETS here, since we don't need
    -                   ;; to do two assignments every time through the
    -                   ;; loop
    -                   (loop for idx from (1+ num) upto (+ num subregister-count) do
    -                        (push nil (svref (the simple-vector a) (the fixnum idx)))))
    +                 (push-offsets *reg-starts* nil *reg-starts-stacks*)
    +                 (push-offsets *regs-maybe-start* nil *regs-maybe-start-stacks*)
    +                 (push-offsets *reg-ends* nil *reg-ends-stacks*)
                      (prog1
                          ;; match the inner regex and the rest of the
                          ;; pattern; restore the original set of register
                          ;; offsets before returning
                          (funcall inner-matcher start-pos)
    -                   (dolist (a (list *reg-starts* *regs-maybe-start* *reg-ends*))
    -                     ;; don't use POP-OFFSETS here, since we don't
    -                     ;; need to collect the POPped values
    -                     (loop for idx from (1+ num) upto (+ num subregister-count) do
    -                          (pop (svref (the simple-vector a) (the fixnum idx)))))
    +                   (pop-offsets *reg-starts* *reg-starts-stacks*)
    +                   (pop-offsets *regs-maybe-start* *regs-maybe-start-stacks*)
    +                   (pop-offsets *reg-ends* *reg-ends-stacks*)
                        (pop subpattern-ref-continuations)))
    -               (let ((old-*reg-starts* (car (svref *reg-starts* num)))
    -                     (old-*regs-maybe-start* (car (svref *regs-maybe-start* num)))
    -                     (old-*reg-ends* (car (svref *reg-ends* num))))
    +               (let ((old-*reg-starts* (svref *reg-starts* num))
    +                     (old-*regs-maybe-start* (svref *regs-maybe-start* num))
    +                     (old-*reg-ends* (svref *reg-ends* num)))
                      ;; we cannot use *REG-STARTS* here because Perl
                      ;; allows regular expressions like /(a|\1x)*/
    -                 (setf (car (svref *regs-maybe-start* num)) start-pos)
    +                 (setf (svref *regs-maybe-start* num) start-pos)
                      (let ((next-pos (funcall inner-matcher start-pos)))
                        (unless next-pos
                          ;; restore old values on failure
    -                     (setf (car (svref *reg-starts* num)) old-*reg-starts*
    -                           (car (svref *regs-maybe-start* num)) old-*regs-maybe-start*
    -                           (car (svref *reg-ends* num)) old-*reg-ends*))
    +                     (setf (svref *reg-starts* num) old-*reg-starts*
    +                           (svref *regs-maybe-start* num) old-*regs-maybe-start*
    +                           (svref *reg-ends* num) old-*reg-ends*))
                        next-pos)))))))))
     
     (defmethod create-matcher-aux ((lookahead lookahead) next-fn)
    
    From 9aaa4daacc780504d91b758a17f97df4a06aa712 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 19:39:55 -0500
    Subject: [PATCH 107/130] Declare type once instead of using THE repeatedly.
    
    ---
     closures.lisp | 12 ++++++++----
     1 file changed, 8 insertions(+), 4 deletions(-)
    
    diff --git a/closures.lisp b/closures.lisp
    index dd4b2c7..4e3a67d 100644
    --- a/closures.lisp
    +++ b/closures.lisp
    @@ -98,13 +98,17 @@ such that the call to NEXT-FN after the match would succeed."))
             ((pop-offsets (offsets offsets-stacks)
                (declare (simple-vector offsets offsets-stacks))
                (loop for idx from (1+ num) upto (+ num subregister-count)
    -                collect (setf (svref offsets (the fixnum idx))
    -                              (pop (svref offsets-stacks (the fixnum idx))))))
    +              collect (let ()
    +                        (declare (fixnum idx))
    +                        (setf (svref offsets idx)
    +                              (pop (svref offsets-stacks idx))))))
              (push-offsets (offsets saved-offsets offsets-stacks)
                (declare (simple-vector offsets offsets-stacks) (list saved-offsets))
                (loop for idx from (1+ num) upto (+ num subregister-count) do
    -                (push (svref offsets (the fixnum idx)) (svref offsets-stacks (the fixnum idx)))
    -                (setf (svref offsets (the fixnum idx)) (pop saved-offsets))))
    +                (let ()
    +                  (declare (fixnum idx))
    +                  (push (svref offsets idx) (svref offsets-stacks idx))
    +                  (setf (svref offsets idx) (pop saved-offsets)))))
              ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which
              ;; will update register offsets after the inner matcher has
              ;; succeded
    
    From f77686c042a305bd7dd097c4a32133147aecc1a7 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 23:08:58 -0500
    Subject: [PATCH 108/130] Add more tests to *TESTS-TO-SKIP*
    
    These are tests that CL-PPCRE gets right but Perl gets wrong, except
    fot 1812, which is caused by validating backreference names too soon.
    ---
     test/perl-tests.lisp | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/test/perl-tests.lisp b/test/perl-tests.lisp
    index a114589..6f06d69 100644
    --- a/test/perl-tests.lisp
    +++ b/test/perl-tests.lisp
    @@ -34,7 +34,9 @@
     
     (in-package :cl-ppcre-test)
     
    -(defvar *tests-to-skip* '(636 638 662 790 1439 1787 1788 1797 1798 1799 1800 1801 1802)
    +(defvar *tests-to-skip*
    +  '(636 638 662 790 1439 1787 1788 1797 1798
    +    1799 1800 1801 1802 1809 1810 1811 1812)
       "Some tests we skip because the testdata is generated by a Perl
     program and CL-PPCRE differs from Perl for these tests - on purpose.")
     
    
    From f50d7a61caba65da85c0b3a3ac633e91e1e7c06a Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 23:16:32 -0500
    Subject: [PATCH 109/130] Move more tests (1809-1812) into test/simple.
    
    These are tests that Perl gets wrong.
    ---
     test/simple | 25 +++++++++++++++++++++++--
     1 file changed, 23 insertions(+), 2 deletions(-)
    
    diff --git a/test/simple b/test/simple
    index ff6f8da..dc9dbd8 100644
    --- a/test/simple
    +++ b/test/simple
    @@ -375,8 +375,9 @@ characters if there's a match."
                    "foo"))
             '(0 3 #(1) #(2)))
     
    -;; The next eight tests correspond to tests 1787, 1788, and 1797-1802 in
    -;; perltestdata.  We reproduce them here because Perl itself gets these wrong.
    +;; The next twelve tests correspond to tests 1787, 1788, 1797-1802, and
    +;; 1809-1812 in perltestdata.  We reproduce them here because Perl itself gets
    +;; these wrong.
     (equalp (multiple-value-list
              (scan "(.)(((?5))(\\1))((?4))" "ffff"))
             '(0 4 #(0 1 1 2 3) #(1 3 2 3 4)))
    @@ -416,3 +417,23 @@ characters if there's a match."
       (equalp (multiple-value-list
                (scan regex "fffffff"))
               '(0 7 #(0 4 4 6) #(1 7 5 7))))
    +
    +(equalp (multiple-value-list
    +         (scan "^(.\\1?)(?1)$" "aba"))
    +        '(0 3 #(0) #(1)))
    +
    +(let ((*allow-named-registers* t)
    +      (regex "^(?.\\k?)(?®One)$"))
    +  (equalp (multiple-value-list
    +           (scan regex "aba"))
    +          '(0 3 #(0) #(1))))
    +
    +(equalp (multiple-value-list
    +         (scan "^(.\\2?)(.)(?1)$" "abcb"))
    +        '(0 4 #(0 1) #(1 2)))
    +
    +;; (let ((*allow-named-registers* t)
    +;;       (regex "^(?.\\k?)(?.)(?®One)$"))
    +;;   (equalp (multiple-value-list
    +;;            (scan regex "abcb"))
    +;;           '(0 4 #(0 1) #(1 2))))
    
    From 53cdefe2f52d4fa1924771068a988eca4d184b7f Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 23:19:45 -0500
    Subject: [PATCH 110/130] Add url reference to comment about Perl mishandling
     certain constructions.
    
    ---
     test/simple | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/test/simple b/test/simple
    index dc9dbd8..d30d5c6 100644
    --- a/test/simple
    +++ b/test/simple
    @@ -378,6 +378,9 @@ characters if there's a match."
     ;; The next twelve tests correspond to tests 1787, 1788, 1797-1802, and
     ;; 1809-1812 in perltestdata.  We reproduce them here because Perl itself gets
     ;; these wrong.
    +;;
    +;; Cf. http://www.nntp.perl.org/group/perl.perl5.porters/2014/02/msg212894.html
    +;; for a discussion of Perl's handling of these.
     (equalp (multiple-value-list
              (scan "(.)(((?5))(\\1))((?4))" "ffff"))
             '(0 4 #(0 1 1 2 3) #(1 3 2 3 4)))
    
    From 2f4c042fa9934799cfb004bafa5807876ac02a62 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Fri, 21 Feb 2014 23:26:06 -0500
    Subject: [PATCH 111/130] Add FIXME comment to come back to later.
    
    Does Perl try to match more than one capture group if more than one
    have the same name?
    ---
     convert.lisp | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/convert.lisp b/convert.lisp
    index c386116..a4e288d 100644
    --- a/convert.lisp
    +++ b/convert.lisp
    @@ -686,6 +686,8 @@ when NAME is not NIL."
             ;; several registers share the same name we will try to match
             ;; any of them, starting with the most recent first
             ;; alternation is used to accomplish matching
    +        ;;
    +        ;; FIXME: Does Perl behave like this?
             (make-instance 'alternation
                            :choices (loop
                                      for reg-index in referred-regs
    
    From 8f838ebf8866200488d3e489c30bc12d73ff0c58 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Sun, 23 Feb 2014 19:53:14 -0500
    Subject: [PATCH 112/130] Add more tests for subpattern-/back-reference
     cooperation.
    
    These currently fail due to Perl's incorrect behavior.  See Perl's RT
    ---
     test/perltestdata  |  6 ++++++
     test/perltestinput | 18 ++++++++++++++++++
     2 files changed, 24 insertions(+)
    
    diff --git a/test/perltestdata b/test/perltestdata
    index 1f3480c..1c5ac28 100644
    --- a/test/perltestdata
    +++ b/test/perltestdata
    @@ -14481,3 +14481,9 @@ foo)" nil nil nil nil "foofoo" t nil nil)
     (1810 "\"aba\" =~ /^(?.\\k?)(?®One)$/" "^(?.\\k?)(?®One)$" nil nil nil nil "aba" nil nil nil)
     (1811 "\"abcb\" =~ /^(.\\2?)(.)(?1)$/" "^(.\\2?)(.)(?1)$" nil nil nil nil "abcb" nil nil nil)
     (1812 "\"abcb\" =~ /^(?.\\k?)(?.)(?®One)$/" "^(?.\\k?)(?.)(?®One)$" nil nil nil nil "abcb" nil nil nil)
    +(1813 "\"aaba\" =~ /^(?3)?((.))(\\2(?1)\\2)$/" "^(?3)?((.))(\\2(?1)\\2)$" nil nil nil nil "aaba" nil "aaba" ("a" "a" "aba"))
    +(1814 "\"aaba\" =~ /^(?®Three)?(?(?.))(?\\k(?®One)\\k)$/" "^(?®Three)?(?(?.))(?\\k(?®One)\\k)$" nil nil nil nil "aaba" nil "aaba" ("a" "a" "aba"))
    +(1815 "\"aaba\" =~ /^(\\3(?2)\\3)?((.))(?1)$/" "^(\\3(?2)\\3)?((.))(?1)$" nil nil nil nil "aaba" nil nil nil)
    +(1816 "\"aaba\" =~ /^(?\\k(?®Two)\\k)?(?(?.))(?®One)$/" "^(?\\k(?®Two)\\k)?(?(?.))(?®One)$" nil nil nil nil "aaba" nil nil nil)
    +(1817 "\"abbcdcabbda\" =~ /^(a|\\3(?1)\\2|(?2))((b|c)(?4)?)(?1)(d(?1))$/" "^(a|\\3(?1)\\2|(?2))((b|c)(?4)?)(?1)(d(?1))$" nil nil nil nil "abbcdcabbda" nil nil nil)
    +(1818 "\"abbcdcabbda\" =~ /^(?a|\\k(?®One)\\k|(?®Two))(?(?b|c)(?®Four)?)(?®One)(?d(?®One))$/" "^(?a|\\k(?®One)\\k|(?®Two))(?(?b|c)(?®Four)?)(?®One)(?d(?®One))$" nil nil nil nil "abbcdcabbda" nil nil nil)
    diff --git a/test/perltestinput b/test/perltestinput
    index fbe9ead..d4e3c73 100644
    --- a/test/perltestinput
    +++ b/test/perltestinput
    @@ -4349,3 +4349,21 @@ foo)/
     
     /^(?.\k?)(?.)(?®One)$/
         abcb
    +
    +/^(?3)?((.))(\2(?1)\2)$/
    +    aaba
    +
    +/^(?®Three)?(?(?.))(?\k(?®One)\k)$/
    +    aaba
    +
    +/^(\3(?2)\3)?((.))(?1)$/
    +    aaba
    +
    +/^(?\k(?®Two)\k)?(?(?.))(?®One)$/
    +    aaba
    +
    +/^(a|\3(?1)\2|(?2))((b|c)(?4)?)(?1)(d(?1))$/
    +    abbcdcabbda
    +
    +/^(?a|\k(?®One)\k|(?®Two))(?(?b|c)(?®Four)?)(?®One)(?d(?®One))$/
    +    abbcdcabbda
    
    From 2fc37a6efccb48f8cac3987632928b273e713f0a Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Sun, 23 Feb 2014 20:21:08 -0500
    Subject: [PATCH 113/130] Move more tests from test/perltestdata into
     test/simple.
    
    ---
     test/perl-tests.lisp |  4 ++--
     test/simple          | 32 ++++++++++++++++++++++++++++----
     2 files changed, 30 insertions(+), 6 deletions(-)
    
    diff --git a/test/perl-tests.lisp b/test/perl-tests.lisp
    index 6f06d69..fbe6bf4 100644
    --- a/test/perl-tests.lisp
    +++ b/test/perl-tests.lisp
    @@ -35,8 +35,8 @@
     (in-package :cl-ppcre-test)
     
     (defvar *tests-to-skip*
    -  '(636 638 662 790 1439 1787 1788 1797 1798
    -    1799 1800 1801 1802 1809 1810 1811 1812)
    +  '(636 638 662 790 1439 1787 1788 1797 1798 1799 1800
    +    1801 1802 1809 1810 1811 1812 1815 1816 1817 1818)
       "Some tests we skip because the testdata is generated by a Perl
     program and CL-PPCRE differs from Perl for these tests - on purpose.")
     
    diff --git a/test/simple b/test/simple
    index d30d5c6..5242bfa 100644
    --- a/test/simple
    +++ b/test/simple
    @@ -375,12 +375,13 @@ characters if there's a match."
                    "foo"))
             '(0 3 #(1) #(2)))
     
    -;; The next twelve tests correspond to tests 1787, 1788, 1797-1802, and
    -;; 1809-1812 in perltestdata.  We reproduce them here because Perl itself gets
    +;; The next sixteen tests correspond to tests 1787, 1788, 1797-1802, 1809-1812,
    +;; 1815-1818 in perltestdata.  We reproduce them here because Perl itself gets
     ;; these wrong.
     ;;
    -;; Cf. http://www.nntp.perl.org/group/perl.perl5.porters/2014/02/msg212894.html
    -;; for a discussion of Perl's handling of these.
    +;; Cf. Perl RT #121299 and the discussion at
    +;; http://www.nntp.perl.org/group/perl.perl5.porters/2014/02/msg212894.html for
    +;; an overview of of Perl's handling of these up through version 5.19 at least.
     (equalp (multiple-value-list
              (scan "(.)(((?5))(\\1))((?4))" "ffff"))
             '(0 4 #(0 1 1 2 3) #(1 3 2 3 4)))
    @@ -435,8 +436,31 @@ characters if there's a match."
              (scan "^(.\\2?)(.)(?1)$" "abcb"))
             '(0 4 #(0 1) #(1 2)))
     
    +;; Cf. #17
     ;; (let ((*allow-named-registers* t)
     ;;       (regex "^(?.\\k?)(?.)(?®One)$"))
     ;;   (equalp (multiple-value-list
     ;;            (scan regex "abcb"))
     ;;           '(0 4 #(0 1) #(1 2))))
    +
    +(equalp (multiple-value-list
    +         (scan "^(\\3(?2)\\3)?((.))(?1)$" "aaba"))
    +        '(0 4 #(nil 0 0) #(nil 1 1)))
    +
    +;; Cf. #17
    +;; (let ((*allow-named-registers* t)
    +;;       (regex "^(?\\k(?®Two)\\k)?(?(?.))(?®One)$"))
    +;;   (equalp (multiple-value-list
    +;;            (scan regex "aaba"))
    +;;           '(0 4 #(nil 0 0) #(nil 1 1))))
    +
    +(equalp (multiple-value-list
    +         (scan "^(a|\\3(?1)\\2|(?2))((b|c)(?4)?)(?1)(d(?1))$" "abbcdcabbda"))
    +        '(0 11 #(0 1 1 9) #(1 2 2 11)))
    +
    +;; Cf. #17
    +;; (let ((*allow-named-registers* t)
    +;;       (regex "^(?a|\\k(?®One)\\k|(?®Two))(?(?b|c)(?®Four)?)(?®One)(?d(?®One))$"))
    +;;   (equalp (multiple-value-list
    +;;            (scan regex "abbcdcabbda"))
    +;;           '(0 11 #(0 1 1 9) #(1 2 2 11))))
    
    From 9b97c918e354e008a3583fcb96495e37c15494cc Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Tue, 25 Feb 2014 22:36:56 -0500
    Subject: [PATCH 114/130] Create new bindings for the referenced register upon
     entry to subpattern-reference.
    
    When entering a register x via subpattern-reference, the registers
    local to x receive new dynamic bindings, which shadow the old bindings
    for the duration of the subpattern call.  Previously, "local" did not
    include the register itself--x in this case.  With this patch, the
    referenced register now receives a new binding as well.
    
    It's not entirely clear that this is the appropriate behavior.  In a
    regex like "(.\1?)(?1)", the back-reference to '\1' now will always
    fail, rather than potentially matching according to what was matched
    in the first pass through the first register.
    ---
     closures.lisp |  4 ++--
     test/simple   | 16 ++++------------
     2 files changed, 6 insertions(+), 14 deletions(-)
    
    diff --git a/closures.lisp b/closures.lisp
    index 4e3a67d..9e12c98 100644
    --- a/closures.lisp
    +++ b/closures.lisp
    @@ -97,14 +97,14 @@ such that the call to NEXT-FN after the match would succeed."))
         (labels
             ((pop-offsets (offsets offsets-stacks)
                (declare (simple-vector offsets offsets-stacks))
    -           (loop for idx from (1+ num) upto (+ num subregister-count)
    +           (loop for idx from num upto (+ num subregister-count)
                   collect (let ()
                             (declare (fixnum idx))
                             (setf (svref offsets idx)
                                   (pop (svref offsets-stacks idx))))))
              (push-offsets (offsets saved-offsets offsets-stacks)
                (declare (simple-vector offsets offsets-stacks) (list saved-offsets))
    -           (loop for idx from (1+ num) upto (+ num subregister-count) do
    +           (loop for idx from num upto (+ num subregister-count) do
                     (let ()
                       (declare (fixnum idx))
                       (push (svref offsets idx) (svref offsets-stacks idx))
    diff --git a/test/simple b/test/simple
    index 5242bfa..6035f4a 100644
    --- a/test/simple
    +++ b/test/simple
    @@ -422,15 +422,11 @@ characters if there's a match."
                (scan regex "fffffff"))
               '(0 7 #(0 4 4 6) #(1 7 5 7))))
     
    -(equalp (multiple-value-list
    -         (scan "^(.\\1?)(?1)$" "aba"))
    -        '(0 3 #(0) #(1)))
    +(null (scan "^(.\\1?)(?1)$" "aba"))
     
     (let ((*allow-named-registers* t)
           (regex "^(?.\\k?)(?®One)$"))
    -  (equalp (multiple-value-list
    -           (scan regex "aba"))
    -          '(0 3 #(0) #(1))))
    +  (null (scan regex "aba")))
     
     (equalp (multiple-value-list
              (scan "^(.\\2?)(.)(?1)$" "abcb"))
    @@ -454,13 +450,9 @@ characters if there's a match."
     ;;            (scan regex "aaba"))
     ;;           '(0 4 #(nil 0 0) #(nil 1 1))))
     
    -(equalp (multiple-value-list
    -         (scan "^(a|\\3(?1)\\2|(?2))((b|c)(?4)?)(?1)(d(?1))$" "abbcdcabbda"))
    -        '(0 11 #(0 1 1 9) #(1 2 2 11)))
    +(null (scan "^(a|\\3(?1)\\2|(?2))((b|c)(?4)?)(?1)(d(?1))$" "abbcdcabbda"))
     
     ;; Cf. #17
     ;; (let ((*allow-named-registers* t)
     ;;       (regex "^(?a|\\k(?®One)\\k|(?®Two))(?(?b|c)(?®Four)?)(?®One)(?d(?®One))$"))
    -;;   (equalp (multiple-value-list
    -;;            (scan regex "abbcdcabbda"))
    -;;           '(0 11 #(0 1 1 9) #(1 2 2 11))))
    +;;   (null (scan regex "abbcdcabbda")))
    
    From 46a078cb92e5ba86fda52f4d53b4fccaae3c9c60 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Thu, 27 Feb 2014 17:49:50 -0500
    Subject: [PATCH 115/130] Remove FIXME comment from convert.lisp.
    
    The issue referred to there is one of the the subjects of #17.
    ---
     convert.lisp | 2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/convert.lisp b/convert.lisp
    index a4e288d..c386116 100644
    --- a/convert.lisp
    +++ b/convert.lisp
    @@ -686,8 +686,6 @@ when NAME is not NIL."
             ;; several registers share the same name we will try to match
             ;; any of them, starting with the most recent first
             ;; alternation is used to accomplish matching
    -        ;;
    -        ;; FIXME: Does Perl behave like this?
             (make-instance 'alternation
                            :choices (loop
                                      for reg-index in referred-regs
    
    From 9b0a9c0703472ce53a12160a57dd3df7641bfd87 Mon Sep 17 00:00:00 2001
    From: Nathan Trapuzzano 
    Date: Thu, 27 Feb 2014 17:55:51 -0500
    Subject: [PATCH 116/130] Use "recurse" instead of "refer" to describe the
     action associated with subpattern references.
    
    ---
     doc/index.html | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/doc/index.html b/doc/index.html
    index 838b299..60dfe87 100644
    --- a/doc/index.html
    +++ b/doc/index.html
    @@ -261,7 +261,7 @@ 

    Scanning

    Since version 2.1.0, CL-PPCRE supports subpattern references, which allow for easy matching of self-similar or recursive patterns. To -refer to a subpattern, use (?N), where N is +recurse to a subpattern, use (?N), where N is the register's number; or (?&name), where name is the register's name.

    From 81be1e4ee4fbea45fd20f7d952078645909ccf7f Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Thu, 27 Feb 2014 20:22:23 -0500 Subject: [PATCH 117/130] Convert calls to PUSH-OFFSETS and POP-OFFSETS to fewer calls to more specific functions. --- closures.lisp | 129 ++++++++++++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 63 deletions(-) diff --git a/closures.lisp b/closures.lisp index 9e12c98..fce08f9 100644 --- a/closures.lisp +++ b/closures.lisp @@ -95,20 +95,33 @@ such that the call to NEXT-FN after the match would succeed.")) (declare (fixnum num subregister-count) (list subpattern-ref-continuations)) (labels - ((pop-offsets (offsets offsets-stacks) - (declare (simple-vector offsets offsets-stacks)) - (loop for idx from num upto (+ num subregister-count) - collect (let () - (declare (fixnum idx)) - (setf (svref offsets idx) - (pop (svref offsets-stacks idx)))))) - (push-offsets (offsets saved-offsets offsets-stacks) - (declare (simple-vector offsets offsets-stacks) (list saved-offsets)) + ((push-registers-state (new-starts new-maybe-starts new-ends) + (declare (list new-starts new-maybe-starts new-ends)) + ;; only push the register states for this register and registers + ;; local to it (loop for idx from num upto (+ num subregister-count) do (let () (declare (fixnum idx)) - (push (svref offsets idx) (svref offsets-stacks idx)) - (setf (svref offsets idx) (pop saved-offsets))))) + (push (svref *reg-ends* idx) (svref *reg-ends-stacks* idx)) + (setf (svref *reg-ends* idx) (pop new-ends)) + (push (svref *regs-maybe-start* idx) (svref *regs-maybe-start-stacks* idx)) + (setf (svref *regs-maybe-start* idx) (pop new-maybe-starts)) + (push (svref *reg-starts* idx) (svref *reg-starts-stacks* idx)) + (setf (svref *reg-starts* idx) (pop new-starts))))) + (pop-registers-state () + ;; return the state that was destroyed by this restore + (let (old-starts old-maybe-starts old-ends) + (declare (list old-starts old-maybe-starts old-ends)) + (loop for idx from (+ num subregister-count) downto num do + (let () + (declare (fixnum idx)) + (push (svref *reg-ends* idx) old-ends) + (setf (svref *reg-ends* idx) (pop (svref *reg-ends-stacks* idx))) + (push (svref *regs-maybe-start* idx) old-maybe-starts) + (setf (svref *regs-maybe-start* idx) (pop (svref *regs-maybe-start-stacks* idx))) + (push (svref *reg-starts* idx) old-starts) + (setf (svref *reg-starts* idx) (pop (svref *reg-starts-stacks* idx))))) + (values old-starts old-maybe-starts old-ends))) ;; STORE-END-OF-REG is a thin wrapper around NEXT-FN which ;; will update register offsets after the inner matcher has ;; succeded @@ -117,20 +130,18 @@ such that the call to NEXT-FN after the match would succeed.")) (function next-fn)) (if subpattern-ref-continuations ;; this register was entered through a subpattern - ;; reference; restore the old register offsets, and - ;; attempt to match the rest of the pattern - (let ((saved-starts (pop-offsets *reg-starts* *reg-starts-stacks*)) - (saved-maybe-starts (pop-offsets *regs-maybe-start* *regs-maybe-start-stacks*)) - (saved-ends (pop-offsets *reg-ends* *reg-ends-stacks*)) - (next-fn (pop subpattern-ref-continuations))) - (prog1 - (funcall (the function next-fn) start-pos) - ;; push the saved register offsets back on so they - ;; can be restored when the stack is unwound - (push-offsets *reg-starts* saved-starts *reg-starts-stacks*) - (push-offsets *regs-maybe-start* saved-maybe-starts *regs-maybe-start-stacks*) - (push-offsets *reg-ends* saved-ends *reg-ends-stacks*) - (push next-fn subpattern-ref-continuations))) + ;; reference; restore the registers state as it was + ;; upon entering the subpattern reference, but save the + ;; intermediary state for when we have to backtrack or + ;; unwind + (multiple-value-bind (saved-starts saved-maybe-starts saved-ends) + (pop-registers-state) + (let ((next-fn (pop subpattern-ref-continuations))) + (prog1 (funcall (the function next-fn) start-pos) + ;; un-restore the registers state so we + ;; backtrack/unwind cleanly + (push-registers-state saved-starts saved-maybe-starts saved-ends) + (push next-fn subpattern-ref-continuations)))) ;; this register was not entered through a subpattern ;; reference; save the start and end positions, and ;; match the rest of the pattern @@ -138,7 +149,7 @@ such that the call to NEXT-FN after the match would succeed.")) (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) (svref *reg-ends* num) start-pos) (funcall next-fn start-pos))))) - (declare (inline pop-offsets push-offsets)) + (declare (inline push-registers-state pop-registers-state)) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER (let ((inner-matcher (create-matcher-aux (regex register) @@ -148,43 +159,35 @@ such that the call to NEXT-FN after the match would succeed.")) ;; special variable so it can be called by subpattern ;; references (setf (getf (car register-matchers) num) - (lambda (start-pos &optional other-fn) - (declare (fixnum start-pos)) - (if other-fn - ;; the presence of OTHER-FN indicates that this - ;; register has been entered via a subpattern reference - ;; closure; - (progn - ;; create a new temporary set of register offsets for - ;; those registers contained within this one in order - ;; to match back references while inside a subpattern - ;; reference, as with Perl; save the old ones - (push other-fn subpattern-ref-continuations) - (push-offsets *reg-starts* nil *reg-starts-stacks*) - (push-offsets *regs-maybe-start* nil *regs-maybe-start-stacks*) - (push-offsets *reg-ends* nil *reg-ends-stacks*) - (prog1 - ;; match the inner regex and the rest of the - ;; pattern; restore the original set of register - ;; offsets before returning - (funcall inner-matcher start-pos) - (pop-offsets *reg-starts* *reg-starts-stacks*) - (pop-offsets *regs-maybe-start* *regs-maybe-start-stacks*) - (pop-offsets *reg-ends* *reg-ends-stacks*) - (pop subpattern-ref-continuations))) - (let ((old-*reg-starts* (svref *reg-starts* num)) - (old-*regs-maybe-start* (svref *regs-maybe-start* num)) - (old-*reg-ends* (svref *reg-ends* num))) - ;; we cannot use *REG-STARTS* here because Perl - ;; allows regular expressions like /(a|\1x)*/ - (setf (svref *regs-maybe-start* num) start-pos) - (let ((next-pos (funcall inner-matcher start-pos))) - (unless next-pos - ;; restore old values on failure - (setf (svref *reg-starts* num) old-*reg-starts* - (svref *regs-maybe-start* num) old-*regs-maybe-start* - (svref *reg-ends* num) old-*reg-ends*)) - next-pos))))))))) + (lambda (start-pos &optional other-fn) + (declare (fixnum start-pos)) + (if other-fn + ;; the presence of OTHER-FN indicates that this + ;; register has been entered via a subpattern + ;; reference closure; save the registers state, + ;; creating fresh new "bindings" for the local + ;; register offsets; restore the state before + ;; returning to the caller + (progn + (push other-fn subpattern-ref-continuations) + (push-registers-state nil nil nil) + (prog1 + (funcall inner-matcher start-pos) + (pop-registers-state) + (pop subpattern-ref-continuations))) + (let ((old-*reg-starts* (svref *reg-starts* num)) + (old-*regs-maybe-start* (svref *regs-maybe-start* num)) + (old-*reg-ends* (svref *reg-ends* num))) + ;; we cannot use *REG-STARTS* here because Perl + ;; allows regular expressions like /(a|\1x)*/ + (setf (svref *regs-maybe-start* num) start-pos) + (let ((next-pos (funcall inner-matcher start-pos))) + (unless next-pos + ;; restore old values on failure + (setf (svref *reg-starts* num) old-*reg-starts* + (svref *regs-maybe-start* num) old-*regs-maybe-start* + (svref *reg-ends* num) old-*reg-ends*)) + next-pos))))))))) (defmethod create-matcher-aux ((lookahead lookahead) next-fn) (declare #.*standard-optimize-settings*) From a941400fc6d14e4f02743911638085d298d82bad Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 28 Feb 2014 06:50:08 -0500 Subject: [PATCH 118/130] Update comment. --- scanner.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scanner.lisp b/scanner.lisp index 2c1747d..0efb96e 100644 --- a/scanner.lisp +++ b/scanner.lisp @@ -142,7 +142,7 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX." ;; that this value will _never_ be decremented - this ;; is crucial to the scanning process (*end-string-pos* (1- *start-pos*)) - ;; the next five will shadow the variables defined by + ;; the next eight will shadow the variables defined by ;; DEFPARAMETER; at this point, we don't know if we'll ;; actually use them, though (*repeat-counters* *repeat-counters*) From 846c22ec60f45767cc94ce25b51dbb5bd418a22e Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 28 Feb 2014 06:55:06 -0500 Subject: [PATCH 119/130] Clarify comments in CREATE-MATCHER-AUX method specialized over registers. --- closures.lisp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/closures.lisp b/closures.lisp index fce08f9..60c6afd 100644 --- a/closures.lisp +++ b/closures.lisp @@ -129,11 +129,11 @@ such that the call to NEXT-FN after the match would succeed.")) (declare (fixnum start-pos) (function next-fn)) (if subpattern-ref-continuations - ;; this register was entered through a subpattern - ;; reference; restore the registers state as it was - ;; upon entering the subpattern reference, but save the - ;; intermediary state for when we have to backtrack or - ;; unwind + ;; we're returning from a register that was entered + ;; through a subpattern reference; restore the + ;; registers state as it was upon entering the + ;; subpattern reference, but save the intermediary + ;; state for when we have to backtrack or unwind (multiple-value-bind (saved-starts saved-maybe-starts saved-ends) (pop-registers-state) (let ((next-fn (pop subpattern-ref-continuations))) @@ -142,9 +142,9 @@ such that the call to NEXT-FN after the match would succeed.")) ;; backtrack/unwind cleanly (push-registers-state saved-starts saved-maybe-starts saved-ends) (push next-fn subpattern-ref-continuations)))) - ;; this register was not entered through a subpattern - ;; reference; save the start and end positions, and - ;; match the rest of the pattern + ;; we're returning from a register that was entered + ;; directly save the start and end positions, and match + ;; the rest of the pattern (progn (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) (svref *reg-ends* num) start-pos) From b5b406ca8b0017290e25c6cf456e470dfac3600b Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 28 Feb 2014 18:43:44 -0500 Subject: [PATCH 120/130] Get rid of useless declaration. --- closures.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/closures.lisp b/closures.lisp index 60c6afd..7e55cf3 100644 --- a/closures.lisp +++ b/closures.lisp @@ -86,7 +86,7 @@ such that the call to NEXT-FN after the match would succeed.")) (defmethod create-matcher-aux ((register register) next-fn) (declare #.*standard-optimize-settings*) - (declare (special register-matchers subpattern-refs)) + (declare (special register-matchers)) (let ((num (num register)) (subregister-count (subregister-count register)) ;; a place to store the next function to call when we arrive From 72d020eadc1fbdf29165cefa8d2b7b7293244ed0 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Fri, 28 Feb 2014 19:00:59 -0500 Subject: [PATCH 121/130] Wrap docstrings to 70 columns. --- specials.lisp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/specials.lisp b/specials.lisp index 3da36bf..48892c5 100644 --- a/specials.lisp +++ b/specials.lisp @@ -88,8 +88,9 @@ of the current register candidates.") (declaim (simple-vector *reg-starts*)) (defvar *reg-starts-stacks* (make-array 0) - "A book-keeping array holding stacks of register start positions for saving -and restoring them upon entering and exiting subpattern references.") + "A book-keeping array holding stacks of register start positions for +saving and restoring them upon entering and exiting subpattern +references.") (declaim (simple-vector *reg-starts-stacks*)) (defvar *regs-maybe-start* (make-array 0) @@ -98,8 +99,9 @@ of the current register candidates.") (declaim (simple-vector *regs-maybe-start*)) (defvar *regs-maybe-start-stacks* (make-array 0) - "A book-keeping array holding stacks of tentative register start positions for -saving and restoring them upon entering and exiting subpattern references.") + "A book-keeping array holding stacks of tentative register start +positions for saving and restoring them upon entering and exiting +subpattern references.") (declaim (simple-vector *regs-maybe-start-stacks*)) (defvar *reg-ends* (make-array 0) @@ -108,8 +110,9 @@ of the current register candidates.") (declaim (simple-vector *reg-ends*)) (defvar *reg-ends-stacks* (make-array 0) - "A book-keeping array holding stacks of register end positions for saving and -restoring them upon entering and exiting subpattern references.") + "A book-keeping array holding stacks of register end positions for +saving and restoring them upon entering and exiting subpattern +references.") (declaim (simple-vector *reg-ends-stacks*)) (defvar *end-string-pos* nil From 498e3f08e36895ce4e8e0cd052a0ebf7ef24770b Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 1 Mar 2014 08:32:15 -0500 Subject: [PATCH 122/130] Fix lexical/special binding bug. This went undetected for so long because of a bug in SBCL (and ECL, apparently). The way it was written, it shouldn't have worked, but it did--except on CLISP, which is how the bug was caught. --- scanner.lisp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scanner.lisp b/scanner.lisp index 0efb96e..0807759 100644 --- a/scanner.lisp +++ b/scanner.lisp @@ -162,7 +162,6 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX." ;; we don't need to try further than MAX-END-POS (max-end-pos (- *end-pos* min-len))) (declare (fixnum scan-start-pos) (function match-fn)) - (declare (special subpattern-refs)) ;; definition of ADVANCE-FN will be inserted here by macrology (labels ((advance-fn-definition)) (declare (inline advance-fn)) @@ -330,10 +329,12 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX." "Auxiliary function to create and return a scanner \(which is actually a closure). Used by CREATE-SCANNER." (declare #.*standard-optimize-settings*) - (declare (fixnum min-len zero-length-num rep-num reg-num)) + (declare (fixnum min-len zero-length-num rep-num reg-num subpattern-refs)) (let ((starts-with-len (if (typep starts-with 'str) (len starts-with))) - (starts-with-everything (typep starts-with 'everything))) + (starts-with-everything (typep starts-with 'everything)) + ;; make lexical copy of SUBPATTERN-REFS for closing over + (subpattern-refs subpattern-refs)) (cond ;; this COND statement dispatches on the different versions we ;; have for ADVANCE-FN and creates different closures for each; From 22082fc50c3404c6328b3ca4a3d11cbf7176f7df Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 1 Mar 2014 13:45:26 -0500 Subject: [PATCH 123/130] Fix indentation of PROG1. --- lexer.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lexer.lisp b/lexer.lisp index 40fe53f..dce2ab3 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -718,7 +718,7 @@ when SUBPATTERN-REFERENCE is true) has already been read. The closing ;; put the digit back (decf (lexer-pos lexer)) (prog1 - (list :subpattern-reference (get-number lexer :no-whitespace-p t)) + (list :subpattern-reference (get-number lexer :no-whitespace-p t)) (let ((next-char (next-char lexer))) (when (or (null next-char) (not (char= (the character next-char) #\)))) From f0bc9f30d12a9b026805ffa702e073ad459fc49c Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 1 Mar 2014 13:49:17 -0500 Subject: [PATCH 124/130] Get rid of extra LET. --- closures.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/closures.lisp b/closures.lisp index 7e55cf3..3e47f32 100644 --- a/closures.lisp +++ b/closures.lisp @@ -503,8 +503,9 @@ against CHR-EXPR." (register-matchers register-matchers)) (declare (fixnum num) (function next-fn)) (lambda (start-pos) - (let ((subpattern-matcher (getf (car register-matchers) (1- num)))) - (funcall (the function subpattern-matcher) start-pos next-fn))))) + (funcall (the function (getf (car register-matchers) (1- num))) + start-pos + next-fn)))) (defmethod create-matcher-aux ((branch branch) next-fn) (declare #.*standard-optimize-settings*) From 2ce2ff77dbec06ca13e8f0a6ce5b57a20cb83081 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 1 Mar 2014 13:56:41 -0500 Subject: [PATCH 125/130] Use COND instead of IF and PROGN. --- closures.lisp | 98 ++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/closures.lisp b/closures.lisp index 3e47f32..3b00eb3 100644 --- a/closures.lisp +++ b/closures.lisp @@ -128,27 +128,28 @@ such that the call to NEXT-FN after the match would succeed.")) (store-end-of-reg (start-pos) (declare (fixnum start-pos) (function next-fn)) - (if subpattern-ref-continuations - ;; we're returning from a register that was entered - ;; through a subpattern reference; restore the - ;; registers state as it was upon entering the - ;; subpattern reference, but save the intermediary - ;; state for when we have to backtrack or unwind - (multiple-value-bind (saved-starts saved-maybe-starts saved-ends) - (pop-registers-state) - (let ((next-fn (pop subpattern-ref-continuations))) - (prog1 (funcall (the function next-fn) start-pos) - ;; un-restore the registers state so we - ;; backtrack/unwind cleanly - (push-registers-state saved-starts saved-maybe-starts saved-ends) - (push next-fn subpattern-ref-continuations)))) - ;; we're returning from a register that was entered - ;; directly save the start and end positions, and match - ;; the rest of the pattern - (progn - (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) - (svref *reg-ends* num) start-pos) - (funcall next-fn start-pos))))) + (cond + (subpattern-ref-continuations + ;; we're returning from a register that was entered + ;; through a subpattern reference; restore the registers + ;; state as it was upon entering the subpattern + ;; reference, but save the intermediary state for when + ;; we have to backtrack or unwind + (multiple-value-bind (saved-starts saved-maybe-starts saved-ends) + (pop-registers-state) + (let ((next-fn (pop subpattern-ref-continuations))) + (prog1 (funcall (the function next-fn) start-pos) + ;; un-restore the registers state so we + ;; backtrack/unwind cleanly + (push-registers-state saved-starts saved-maybe-starts saved-ends) + (push next-fn subpattern-ref-continuations))))) + (t + ;; we're returning from a register that was entered + ;; directly save the start and end positions, and match + ;; the rest of the pattern + (setf (svref *reg-starts* num) (svref *regs-maybe-start* num) + (svref *reg-ends* num) start-pos) + (funcall next-fn start-pos))))) (declare (inline push-registers-state pop-registers-state)) ;; the inner matcher is a closure corresponding to the regex ;; wrapped by this REGISTER @@ -161,33 +162,34 @@ such that the call to NEXT-FN after the match would succeed.")) (setf (getf (car register-matchers) num) (lambda (start-pos &optional other-fn) (declare (fixnum start-pos)) - (if other-fn - ;; the presence of OTHER-FN indicates that this - ;; register has been entered via a subpattern - ;; reference closure; save the registers state, - ;; creating fresh new "bindings" for the local - ;; register offsets; restore the state before - ;; returning to the caller - (progn - (push other-fn subpattern-ref-continuations) - (push-registers-state nil nil nil) - (prog1 - (funcall inner-matcher start-pos) - (pop-registers-state) - (pop subpattern-ref-continuations))) - (let ((old-*reg-starts* (svref *reg-starts* num)) - (old-*regs-maybe-start* (svref *regs-maybe-start* num)) - (old-*reg-ends* (svref *reg-ends* num))) - ;; we cannot use *REG-STARTS* here because Perl - ;; allows regular expressions like /(a|\1x)*/ - (setf (svref *regs-maybe-start* num) start-pos) - (let ((next-pos (funcall inner-matcher start-pos))) - (unless next-pos - ;; restore old values on failure - (setf (svref *reg-starts* num) old-*reg-starts* - (svref *regs-maybe-start* num) old-*regs-maybe-start* - (svref *reg-ends* num) old-*reg-ends*)) - next-pos))))))))) + (cond + (other-fn + ;; the presence of OTHER-FN indicates that this + ;; register has been entered via a subpattern + ;; reference closure; save the registers state, + ;; creating fresh new "bindings" for the local + ;; register offsets; restore the state before + ;; returning to the caller + (push other-fn subpattern-ref-continuations) + (push-registers-state nil nil nil) + (prog1 + (funcall inner-matcher start-pos) + (pop-registers-state) + (pop subpattern-ref-continuations))) + (t + (let ((old-*reg-starts* (svref *reg-starts* num)) + (old-*regs-maybe-start* (svref *regs-maybe-start* num)) + (old-*reg-ends* (svref *reg-ends* num))) + ;; we cannot use *REG-STARTS* here because Perl + ;; allows regular expressions like /(a|\1x)*/ + (setf (svref *regs-maybe-start* num) start-pos) + (let ((next-pos (funcall inner-matcher start-pos))) + (unless next-pos + ;; restore old values on failure + (setf (svref *reg-starts* num) old-*reg-starts* + (svref *regs-maybe-start* num) old-*regs-maybe-start* + (svref *reg-ends* num) old-*reg-ends*)) + next-pos)))))))))) (defmethod create-matcher-aux ((lookahead lookahead) next-fn) (declare #.*standard-optimize-settings*) From dc6eaa4961ec19caff8bf2910ca0c16fb9a86e13 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 1 Mar 2014 14:11:56 -0500 Subject: [PATCH 126/130] Rename OTHER-FN -> CONT. --- closures.lisp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/closures.lisp b/closures.lisp index 3b00eb3..5e2e12c 100644 --- a/closures.lisp +++ b/closures.lisp @@ -160,17 +160,17 @@ such that the call to NEXT-FN after the match would succeed.")) ;; special variable so it can be called by subpattern ;; references (setf (getf (car register-matchers) num) - (lambda (start-pos &optional other-fn) + (lambda (start-pos &optional cont) (declare (fixnum start-pos)) (cond - (other-fn - ;; the presence of OTHER-FN indicates that this + (cont + ;; the presence of CONT indicates that this ;; register has been entered via a subpattern ;; reference closure; save the registers state, ;; creating fresh new "bindings" for the local ;; register offsets; restore the state before ;; returning to the caller - (push other-fn subpattern-ref-continuations) + (push cont subpattern-ref-continuations) (push-registers-state nil nil nil) (prog1 (funcall inner-matcher start-pos) From 7d5c4d4f686ce1da7f936a7938d00242f5018a46 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 1 Mar 2014 14:12:15 -0500 Subject: [PATCH 127/130] Replace another IF/PROGN with COND. --- lexer.lisp | 63 +++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/lexer.lisp b/lexer.lisp index dce2ab3..5303a9b 100644 --- a/lexer.lisp +++ b/lexer.lisp @@ -667,37 +667,38 @@ when SUBPATTERN-REFERENCE is true) has already been read. The closing ;; might be a look-behind assertion or a named group, so ;; check next character (let ((next-char (next-char-non-extended lexer))) - (if (alpha-char-p next-char) - (progn - ;; we have encountered a named group - ;; are we supporting register naming? - (unless *allow-named-registers* - (signal-syntax-error* (1- (lexer-pos lexer)) - "Character '~A' may not follow '(?<'." - next-char)) - ;; put the letter back - (decf (lexer-pos lexer)) - ;; named group - :open-paren-less-letter) - (case next-char - ((#\=) - ;; positive look-behind - :open-paren-less-equal) - ((#\!) - ;; negative look-behind - :open-paren-less-exclamation) - ((#\)) - ;; Perl allows "(?<)" and treats - ;; it like a null string - :void) - ((nil) - ;; syntax error - (signal-syntax-error "End of string following '(?<'.")) - (t - ;; also syntax error - (signal-syntax-error* (1- (lexer-pos lexer)) - "Character '~A' may not follow '(?<'." - next-char)))))) + (cond + ((alpha-char-p next-char) + ;; we have encountered a named group + ;; are we supporting register naming? + (unless *allow-named-registers* + (signal-syntax-error* (1- (lexer-pos lexer)) + "Character '~A' may not follow '(?<'." + next-char)) + ;; put the letter back + (decf (lexer-pos lexer)) + ;; named group + :open-paren-less-letter) + (t + (case next-char + ((#\=) + ;; positive look-behind + :open-paren-less-equal) + ((#\!) + ;; negative look-behind + :open-paren-less-exclamation) + ((#\)) + ;; Perl allows "(?<)" and treats it + ;; like a null string + :void) + ((nil) + ;; syntax error + (signal-syntax-error "End of string following '(?<'.")) + (t + ;; also syntax error + (signal-syntax-error* (1- (lexer-pos lexer)) + "Character '~A' may not follow '(?<'." + next-char))))))) ((#\&) ;; subpattern reference by register name (unless *allow-named-registers* From a833ffbdf585598ced1e799961843fcdfc2a688f Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 1 Mar 2014 14:19:17 -0500 Subject: [PATCH 128/130] Use LOCALLY instead of LET with no bindings. --- closures.lisp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/closures.lisp b/closures.lisp index 5e2e12c..50da5b0 100644 --- a/closures.lisp +++ b/closures.lisp @@ -100,8 +100,7 @@ such that the call to NEXT-FN after the match would succeed.")) ;; only push the register states for this register and registers ;; local to it (loop for idx from num upto (+ num subregister-count) do - (let () - (declare (fixnum idx)) + (locally (declare (fixnum idx)) (push (svref *reg-ends* idx) (svref *reg-ends-stacks* idx)) (setf (svref *reg-ends* idx) (pop new-ends)) (push (svref *regs-maybe-start* idx) (svref *regs-maybe-start-stacks* idx)) @@ -113,8 +112,7 @@ such that the call to NEXT-FN after the match would succeed.")) (let (old-starts old-maybe-starts old-ends) (declare (list old-starts old-maybe-starts old-ends)) (loop for idx from (+ num subregister-count) downto num do - (let () - (declare (fixnum idx)) + (locally (declare (fixnum idx)) (push (svref *reg-ends* idx) old-ends) (setf (svref *reg-ends* idx) (pop (svref *reg-ends-stacks* idx))) (push (svref *regs-maybe-start* idx) old-maybe-starts) From bef1a6aaf04c41f71c3dc29748fdb2bc861e94b0 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 1 Mar 2014 16:55:09 -0500 Subject: [PATCH 129/130] Rename SUBREGISTER-COUNT -> INNER-REGISTER-COUNT. --- closures.lisp | 8 ++++---- convert.lisp | 2 +- regex-class-util.lisp | 2 +- regex-class.lisp | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/closures.lisp b/closures.lisp index 50da5b0..f7d7604 100644 --- a/closures.lisp +++ b/closures.lisp @@ -88,18 +88,18 @@ such that the call to NEXT-FN after the match would succeed.")) (declare #.*standard-optimize-settings*) (declare (special register-matchers)) (let ((num (num register)) - (subregister-count (subregister-count register)) + (inner-register-count (inner-register-count register)) ;; a place to store the next function to call when we arrive ;; here via a subpattern reference subpattern-ref-continuations) - (declare (fixnum num subregister-count) + (declare (fixnum num inner-register-count) (list subpattern-ref-continuations)) (labels ((push-registers-state (new-starts new-maybe-starts new-ends) (declare (list new-starts new-maybe-starts new-ends)) ;; only push the register states for this register and registers ;; local to it - (loop for idx from num upto (+ num subregister-count) do + (loop for idx from num upto (+ num inner-register-count) do (locally (declare (fixnum idx)) (push (svref *reg-ends* idx) (svref *reg-ends-stacks* idx)) (setf (svref *reg-ends* idx) (pop new-ends)) @@ -111,7 +111,7 @@ such that the call to NEXT-FN after the match would succeed.")) ;; return the state that was destroyed by this restore (let (old-starts old-maybe-starts old-ends) (declare (list old-starts old-maybe-starts old-ends)) - (loop for idx from (+ num subregister-count) downto num do + (loop for idx from (+ num inner-register-count) downto num do (locally (declare (fixnum idx)) (push (svref *reg-ends* idx) old-ends) (setf (svref *reg-ends* idx) (pop (svref *reg-ends-stacks* idx))) diff --git a/convert.lisp b/convert.lisp index c386116..d34288b 100644 --- a/convert.lisp +++ b/convert.lisp @@ -616,7 +616,7 @@ when NAME is not NIL." :regex (convert-aux (if name (third parse-tree) (second parse-tree))) :num stored-reg-num :name name - :subregister-count (- (the fixnum reg-num) stored-reg-num 1)))) + :inner-register-count (- (the fixnum reg-num) stored-reg-num 1)))) (defmethod convert-compound-parse-tree ((token (eql :named-register)) parse-tree &key) "The case for \(:NAMED-REGISTER )." diff --git a/regex-class-util.lisp b/regex-class-util.lisp index cea9d58..6c7f7d0 100644 --- a/regex-class-util.lisp +++ b/regex-class-util.lisp @@ -147,7 +147,7 @@ which are not of type STR.")) :regex (copy-regex (regex register)) :num (num register) :name (name register) - :subregister-count (subregister-count register))) + :inner-register-count (inner-register-count register))) (defmethod copy-regex ((standalone standalone)) (declare #.*standard-optimize-settings*) diff --git a/regex-class.lisp b/regex-class.lisp index cddc75f..f5c5fc6 100644 --- a/regex-class.lisp +++ b/regex-class.lisp @@ -124,10 +124,10 @@ This is the index into *REGS-START* and *REGS-END*.") (name :initarg :name :reader name :documentation "Name of this register or NIL.") - (subregister-count :initarg :subregister-count - :reader subregister-count - :type fixnum - :documentation "The number of registers nested within this register.")) + (inner-register-count :initarg :inner-register-count + :reader inner-register-count + :type fixnum + :documentation "The number of registers nested within this register.")) (:documentation "REGISTER objects represent register groups.")) (defmethod print-object ((register register) stream) From 8a288eb97dc9829603d8ecff031202d9599f10de Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sun, 2 Mar 2014 14:08:00 -0500 Subject: [PATCH 130/130] Fix declaration on SUBPATTERN-REFS. This should be a SPECIAL declaration, not a type declaration. --- scanner.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scanner.lisp b/scanner.lisp index 0807759..dd0eaf2 100644 --- a/scanner.lisp +++ b/scanner.lisp @@ -329,7 +329,8 @@ ADVANCE-FN. This is a utility macro used by CREATE-SCANNER-AUX." "Auxiliary function to create and return a scanner \(which is actually a closure). Used by CREATE-SCANNER." (declare #.*standard-optimize-settings*) - (declare (fixnum min-len zero-length-num rep-num reg-num subpattern-refs)) + (declare (fixnum min-len zero-length-num rep-num reg-num)) + (declare (special subpattern-refs)) (let ((starts-with-len (if (typep starts-with 'str) (len starts-with))) (starts-with-everything (typep starts-with 'everything))