parseUnicodeRanges
parseUnicodeRanges(
ranges: string,
): null | (number | readonly [number, number])[]Parameters
ranges: string
The string of Unicode ranges to parse.
Returns
null | (number | readonly [number, number])[]An array of numbers, or tuples of numbers for ranges. If the input string contains invalid syntax, returns null.
Parse a series of Unicode code point ranges.
Functions that take a character range as input will parse them for you, but you may find this useful if you want to do other things with character ranges and parse them the same way as this package does.
Parsing is rather lenient. The parser accepts single code points (e.g. U+0041), ranges (e.g. U+0041-5A), and wildcards (e.g. U+09??). They can be separated by spaces, commas, or both. The leading 'U+' can be present or absent, and it's all case-insensitive.