@@ -1069,6 +1069,23 @@ extension RegexTests {
10691069 ( " Sol Cafe " , nil ) , xfail: true )
10701070 }
10711071
1072+ func testLevel2WordBoundaries( ) {
1073+ // MARK: Level 2 Word Boundaries
1074+ firstMatchTest ( #"\b😊\b"# , input: " 🔥😊👍 " , match: " 😊 " )
1075+ firstMatchTest ( #"\b👨🏽\b"# , input: " 👩🏻👶🏿👨🏽🧑🏾👩🏼 " , match: " 👨🏽 " )
1076+ firstMatchTest ( #"\b🇺🇸\b"# , input: " 🇨🇦🇺🇸🇲🇽 " , match: " 🇺🇸 " )
1077+ firstMatchTest ( #"\b.+\b"# , input: " €1 234,56 " , match: " €1 234,56 " )
1078+ firstMatchTest ( #"〱\B㋞\Bツ"# , input: " 〱㋞ツ " , match: " 〱㋞ツ " )
1079+ firstMatchTest ( #"\bhello\b"# , input: " hello〱㋞ツ " , match: " hello " )
1080+ firstMatchTest ( #"\bChicago\b"# , input: " 나는 Chicago에 산다 " , match: " Chicago " )
1081+ firstMatchTest ( #"\blove\b"# , input: " 眼睛love食物 " , match: " love " )
1082+ firstMatchTest ( #"\b\u{d}\u{a}\b"# , input: " \u{d} \u{a} " , match: " \u{d} \u{a} " )
1083+ firstMatchTest ( #"\bㅋㅋㅋ\b"# , input: " 아니ㅋㅋㅋ네 " , match: " ㅋㅋㅋ " )
1084+ firstMatchTest ( #"Re\B\:\BZero"# , input: " Re:Zero Starting Life in Another World " , match: " Re:Zero " )
1085+ firstMatchTest ( #"can\B\'\Bt"# , input: " I can't do that. " , match: " can't " )
1086+ firstMatchTest ( #"\b÷\b"# , input: " 3 ÷ 3 = 1 " , match: " ÷ " )
1087+ }
1088+
10721089 func testMatchGroups( ) {
10731090 // MARK: Groups
10741091
@@ -1475,12 +1492,12 @@ extension RegexTests {
14751492 #"(?W)abcd\b.+"# ,
14761493 ( " abcd ef " , true ) ,
14771494 ( " abcdef " , false ) ,
1478- ( " abcdéf " , true ) ) // "dé" matches /d\b./ because "é" isn't ASCII
1495+ ( " abcdéf " , false ) )
14791496 matchTest (
14801497 #"(?P)abcd\b.+"# ,
14811498 ( " abcd ef " , true ) ,
14821499 ( " abcdef " , false ) ,
1483- ( " abcdéf " , true ) ) // "dé" matches /d\b./ because "é" isn't ASCII
1500+ ( " abcdéf " , false ) )
14841501
14851502 // 'S' ASCII-only spaces
14861503 matchTest (
0 commit comments