Skip to content

Commit 3f2832d

Browse files
committed
Fix HexDigit definition in RegexSyntax.md
1 parent 115a937 commit 3f2832d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Documentation/Evolution/RegexSyntaxRunTimeConstruction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ UnicodeScalar -> '\u{' HexDigit{1...} '}'
339339
| '\o{' OctalDigit{1...} '}'
340340
| '\0' OctalDigit{0...3}
341341
342-
HexDigit -> [0-9a-zA-Z]
342+
HexDigit -> [0-9a-fA-F]
343343
OctalDigit -> [0-7]
344344
345345
NamedScalar -> '\N{' ScalarName '}'

Tests/RegexTests/ParseTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,6 +2313,10 @@ extension RegexTests {
23132313
diagnosticTest("{5}", .quantifierRequiresOperand("{5}"))
23142314
diagnosticTest("{1,3}", .quantifierRequiresOperand("{1,3}"))
23152315

2316+
// MARK: Unicode scalars
2317+
2318+
diagnosticTest(#"\u{G}"#, .expectedNumber("G", kind: .hex))
2319+
23162320
// MARK: Matching options
23172321

23182322
diagnosticTest(#"(?^-"#, .cannotRemoveMatchingOptionsAfterCaret)

0 commit comments

Comments
 (0)