We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0fbe9f commit a801234Copy full SHA for a801234
Tests/RegexTests/MatchTests.swift
@@ -1099,6 +1099,12 @@ extension RegexTests {
1099
(input: "aa", match: "aa"),
1100
(input: "aaa", match: nil))
1101
1102
+ // Capture behavior in non-atomic vs atomic groups
1103
+ firstMatchTests(
1104
+ #"(\d+)\w+\1"#,
1105
+ (input: "123x12", match: "123x12"), // `\w+` matches "3x" in this case
1106
+ (input: "23x23", match: "23x23"),
1107
+ (input: "123x23", match: "23x23"))
1108
firstMatchTests(
1109
#"(?>(\d+))\w+\1"#,
1110
(input: "123x12", match: nil))
0 commit comments