Timeline for POSIX: Regular Expression: "\(a\(b\)*\)*\2" matches "abab"
Current License: CC BY-SA 4.0
Post Revisions
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| 2 hours ago | comment | added | Stéphane Chazelas | BTW the links to the js regex library at becke.ch seem to be broken. | |
| 3 hours ago | vote | accept | becke-ch | ||
| 3 hours ago | history | became hot network question | |||
| 3 hours ago | answer | added | Stéphane Chazelas | timeline score: 6 | |
| 4 hours ago | history | edited | Stéphane Chazelas | CC BY-SA 4.0 |
added 113 characters in body
|
| 4 hours ago | comment | added | Stéphane Chazelas |
(see: re='\(a\(b\)*\)*\2' string=abab ksh93 -c '[[ $string = ~(G)$re ]]'; G for BRE)
|
|
| 4 hours ago | comment | added | Stéphane Chazelas | That text was suggested in 2004 by Glenn Fowler from AT&T Labs Research, and you can see it doesn't match in ksh93 that still uses their regex implementation. | |
| 6 hours ago | comment | added | Kusalananda♦ |
The implementations (tested sed and GNU sed on OpenBSD) seem to ignore "If the containing subexpression does not match, or if there is no match for the contained subexpression within the string matched by the containing subexpression, then back-reference expressions corresponding to the contained subexpression shall not match". Because with \1 = a (note: not ab) and \2 = b, how can \(a\(b\)*\)*\2 match abab when "there is no match for the contained subexpression within the string matched by the containing subexpression"?
|
|
| 16 hours ago | history | asked | becke-ch | CC BY-SA 4.0 |