Skip to content

Commit 45e8a1f

Browse files
committed
Fix HexDigit definition in RegexSyntax.md
1 parent 1310985 commit 45e8a1f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Documentation/Evolution/RegexSyntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ UnicodeScalar -> '\u{' HexDigit{1...} '}'
263263
| '\o{' OctalDigit{1...} '}'
264264
| '\0' OctalDigit{0...3}
265265
266-
HexDigit -> [0-9a-zA-Z]
266+
HexDigit -> [0-9a-fA-F]
267267
OctalDigit -> [0-7]
268268
269269
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)