3 ms·
Fun fact: Rust's regex crate won't let you do this. If you try to escape a character that isn't a meta character, you get an error. So in cases like this, it wi
by burntsushi 5y ago
Fun fact: Rust's regex crate won't let you do this. If you try to escape a character that isn't a meta character, you get an error. So in cases like this, it will erase your doubt.
(There is ongoing discussion about relaxing this rule for some characters, since it is so common in some cases. For example, escaping / so common that folks try to do it with the regex crate and are surprised when it returns an error. / is rarely a regex meta character, rather, it tends to denote the start and stop of regexes, e.g., in Javascript or sed.)