The escape sequence \u{hhhhhh}
throws a FormatException
if hhhhhh
is not a Unicode scalar value. Sometimes, a user might want to search for unmatched surrogate halves, or match a non-string integer sequence and only use the regex syntax to construct their scanner.
For these cases, a pattern \x{h+}
should be added that matches the specified number, regardless of whether this number lies outside the Unicode scalar value range.