Skip to content

Commit 6c88155

Browse files
natecook1000milseman
authored andcommitted
Test semantic whitespace in quote in extended region
1 parent 382bde5 commit 6c88155

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/RegexTests/MatchTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,6 +1395,14 @@ extension RegexTests {
13951395
firstMatchTest(#"(?xx)[ \t]+"#, input: " \t \t", match: "\t")
13961396

13971397
firstMatchTest("(?xx)[ a && ab ]+", input: " aaba ", match: "aa")
1398+
1399+
// Preserve whitespace in quoted section inside extended syntax region
1400+
firstMatchTest(
1401+
#"(?x) a b \Q c d \E e f"#, input: "ab c d ef", match: "ab c d ef")
1402+
firstMatchTest(
1403+
#"(?x)[a b]+ _ [a\Q b\E]+"#, input: "aba_ a b a", match: "aba_ a b a")
1404+
firstMatchTest(
1405+
#"(?x)[a b]+ _ [a\Q b\E]+"#, input: "aba _ a b a", match: nil)
13981406
}
13991407

14001408
func testASCIIClasses() {

0 commit comments

Comments
 (0)