BSON::Regex
BSON regular expression: a pattern C string and an options C string.
This type does not compile the pattern. Unusual or invalid patterns stay
as text and can round-trip. Call #to_regex when you want a Crystal Regex.
Constructors
Create from a pattern and option letters. Letters are stored unique and in alphabetical order, as required by the BSON spec.
Class methods
Map BSON option letters to Crystal flags. Unknown letters are ignored.
Map Crystal regex flags to BSON letters in alphabetical order: i, m, s, u, x.
Unique option letters in alphabetical order. Extra letters are kept.
Write BSON regex option letters in alphabetical order: i, m, s, u, x.
Instance methods
Serialize to a canonical extended json representation.
NOTE: see https://github.com/mongodb/specifications/blob/master/source/extended-json.rst