You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code compiles, but the group just contains the last capture:
var m: RegexMatchdoAssert"abab".match(re"(?P<foo>ab)(?P<foo>ab)", m)
doAssert m.group("foo") ==@[2..3]
doAssert m.group(0) ==@[0..1]
doAssert m.group(1) ==@[2..3]
So, we can either throw a compile error, same as PCRE, or we can make foo return both group captures. The latter sounds like a nice feature for expressions like "(?P<foo>ab)|(?P<foo>cd)|(?P<foo>ef)".
The text was updated successfully, but these errors were encountered:
The following code compiles, but the group just contains the last capture:
So, we can either throw a compile error, same as PCRE, or we can make
foo
return both group captures. The latter sounds like a nice feature for expressions like"(?P<foo>ab)|(?P<foo>cd)|(?P<foo>ef)"
.The text was updated successfully, but these errors were encountered: