unicode-intervals
This library provides a way to search for Unicode code point intervals by categories, ranges, and custom character sets.
The main purpose of unicode-intervals is to simplify generating strings that matching specific criteria.
[]
= "0.1"
Examples
The example below will produce code point intervals of uppercase & lowercase letters less than 128 and will include the ☃ character.
use UnicodeCategory;
let intervals = query
.include_categories
.max_codepoint
.include_characters
.intervals
.expect;
assert_eq!;
IntervalSet for index-like access to the underlying codepoints:
let interval_set = query
.max_codepoint
.interval_set
.expect;
// Get 10th codepoint in this interval set
assert_eq!;
assert_eq!;
Query specific Unicode version:
use UnicodeVersion;
let intervals = V11_0_0.query
.max_codepoint
.include_characters
.intervals
.expect;
assert_eq!;
Restrict the output to code points within a certain range:
let intervals = query
.min_codepoint
.max_codepoint
.intervals
.expect;
assert_eq!
Include or exclude specific characters:
use UnicodeCategory;
let intervals = query
.include_categories
.include_characters
.intervals
.expect;
assert_eq!
Unicode version support
unicode-intervals supports Unicode 9.0.0 - 15.0.0.