From: Ronald J. Kimball Date: Thu, 17 May 2001 12:20:33 +0000 (-0400) Subject: Re: [PATCH] HERE mark in regex X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=24b616965791b0bdc58cd14f68c59b427198082f;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] HERE mark in regex Message-ID: <20010517122033.B1547290@linguist.thayer.dartmouth.edu> p4raw-id: //depot/perl@10146 --- diff --git a/t/op/re_tests b/t/op/re_tests index 5636af4..c83d742 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -45,9 +45,9 @@ a[b-d]e ace y $& ace a[b-d] aac y $& ac a[-b] a- y $& a- a[b-] a- y $& a- -a[b-a] - c - Invalid [] range "b-a" in regex; marked by <-- HERE in m/a[b-a <-- HERE ]/ -a[]b - c - Unmatched [ in regex; marked by <-- HERE in m/a[ <-- HERE ]b/ -a[ - c - Unmatched [ in regex; marked by <-- HERE in m/a[ <-- HERE / +a[b-a] - c - Invalid [] range "b-a" +a[]b - c - Unmatched [ +a[ - c - Unmatched [ a] a] y $& a] a[]]b a]b y $& a]b a[^bc]d aed y $& aed @@ -95,21 +95,21 @@ a[\S]b a-b y - - ab|cd abc y $& ab ab|cd abcd y $& ab ()ef def y $&-$1 ef- -*a - c - Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE a/ -(*)b - c - Quantifier follows nothing in regex; marked by <-- HERE in m/(* <-- HERE )b/ +*a - c - Quantifier follows nothing +(*)b - c - Quantifier follows nothing $b b n - - a\ - c - Search pattern not terminated a\(b a(b y $&-$1 a(b- a\(*b ab y $& ab a\(*b a((b y $& a((b a\\b a\b y $& a\b -abc) - c - Unmatched ) in regex; marked by <-- HERE in m/abc) <-- HERE / -(abc - c - Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE abc/ +abc) - c - Unmatched ) +(abc - c - Unmatched ( ((a)) abc y $&-$1-$2 a-a-a (a)b(c) abc y $&-$1-$2 abc-a-c a+b+c aabbabc y $& abc a{1,}b{1,}c aabbabc y $& abc -a** - c - Nested quantifiers in regex; marked by <-- HERE in m/a** <-- HERE / +a** - c - Nested quantifiers a.+?c abcabc y $& abc (a+|b)* ab y $&-$1 ab-b (a+|b){0,} ab y $&-$1 ab-b @@ -117,7 +117,7 @@ a.+?c abcabc y $& abc (a+|b){1,} ab y $&-$1 ab-b (a+|b)? ab y $&-$1 a-a (a+|b){0,1} ab y $&-$1 a-a -)( - c - Unmatched ) in regex; marked by <-- HERE in m/) <-- HERE (/ +)( - c - Unmatched ) [^ab]* cde y $& cde abc n - - a* y $& @@ -218,9 +218,9 @@ a[-]?c ac y $& ac 'a[b-d]'i AAC y $& AC 'a[-b]'i A- y $& A- 'a[b-]'i A- y $& A- -'a[b-a]'i - c - Invalid [] range "b-a" in regex; marked by <-- HERE in m/a[b-a <-- HERE ]/ -'a[]b'i - c - Unmatched [ in regex; marked by <-- HERE in m/a[ <-- HERE ]b/ -'a['i - c - Unmatched [ in regex; marked by <-- HERE in m/a[ <-- HERE / +'a[b-a]'i - c - Invalid [] range "b-a" +'a[]b'i - c - Unmatched [ +'a['i - c - Unmatched [ 'a]'i A] y $& A] 'a[]]b'i A]B y $& A]B 'a[^bc]d'i AED y $& AED @@ -232,21 +232,21 @@ a[-]?c ac y $& ac 'ab|cd'i ABC y $& AB 'ab|cd'i ABCD y $& AB '()ef'i DEF y $&-$1 EF- -'*a'i - c - Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE a/ -'(*)b'i - c - Quantifier follows nothing in regex; marked by <-- HERE in m/(* <-- HERE )b/ +'*a'i - c - Quantifier follows nothing +'(*)b'i - c - Quantifier follows nothing '$b'i B n - - 'a\'i - c - Search pattern not terminated 'a\(b'i A(B y $&-$1 A(B- 'a\(*b'i AB y $& AB 'a\(*b'i A((B y $& A((B 'a\\b'i A\B y $& A\B -'abc)'i - c - Unmatched ) in regex; marked by <-- HERE in m/abc) <-- HERE / -'(abc'i - c - Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE abc/ +'abc)'i - c - Unmatched ) +'(abc'i - c - Unmatched ( '((a))'i ABC y $&-$1-$2 A-A-A '(a)b(c)'i ABC y $&-$1-$2 ABC-A-C 'a+b+c'i AABBABC y $& ABC 'a{1,}b{1,}c'i AABBABC y $& ABC -'a**'i - c - Nested quantifiers in regex; marked by <-- HERE in m/a** <-- HERE / +'a**'i - c - Nested quantifiers 'a.+?c'i ABCABC y $& ABC 'a.*?c'i ABCABC y $& ABC 'a.{0,5}?c'i ABCABC y $& ABC @@ -257,7 +257,7 @@ a[-]?c ac y $& ac '(a+|b)?'i AB y $&-$1 A-A '(a+|b){0,1}'i AB y $&-$1 A-A '(a+|b){0,1}?'i AB y $&-$1 - -')('i - c - Unmatched ) in regex; marked by <-- HERE in m/) <-- HERE (/ +')('i - c - Unmatched ) '[^ab]*'i CDE y $& CDE 'abc'i n - - 'a*'i y $& @@ -346,7 +346,7 @@ a(?:b|(c|e){1,2}?|d)+?(.) ace y $1$2 ce (?a+)b) aaab y $1 aaab (?>(a+))b aaab y $1 aaa ((?>[^()]+)|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x -(?<=x+)y - c - Variable length lookbehind not implemented in regex; marked by <-- HERE in m/(?<=x+) <-- HERE y/ +(?<=x+)y - c - Variable length lookbehind not implemented a{37,17} - c - Can't do {n,m} with n > m \Z a\nb\n y $-[0] 3 \z a\nb\n y $-[0] 4