//! Character classes that mean in Rust what they mean in Python. //! //! The two regex engines disagree about `\s`, `\w` and therefore `\b`, and //! every disagreement is a heuristic that fires on one side and not the //! other. The differences are small and entirely real: //! //! - Python's `\s` also matches `U+001C`–`U+001F`, the four ASCII //! information separators. //! - Python's `\w` is the letters, the numbers and the underscore. Rust's //! adds every combining mark, every connector punctuation mark and the //! join controls, and leaves out the letter-like and other numbers — so //! `Gödel` written in decomposed form is one word to Rust and two to //! Python, and `²` is a word character to Python and not to Rust. //! - `\b` is defined in terms of `\w`, so it inherits all of that. //! //! Spell a ported pattern with these and it means the same thing on both //! sides. The boundary forms are lookarounds, so a pattern using them needs //! an engine that has them. /// Python's `\s`. pub const SPACE: &str = r"[\s\x{1c}-\x{1f}]"; /// Python's `\w`. pub const WORD: &str = r"[\p{L}\p{N}_]"; /// Python's `\b`, before a word. pub const WORD_START: &str = r"(?