Returns true if the give character has significance in a regex. These are the only characters that are allowed to be escaped, with one exception: an ASCII space character may be escaped when extended mode (with the `x` flag) is enabld. In particular, `is_meta_character(' ')` returns `false`. Note that the set of characters for which this function returns `true` or `false` is fixed and won't chan
(c: char)
| 151 | /// Note that the set of characters for which this function returns `true` or |
| 152 | /// `false` is fixed and won't change in a semver compatible release. |
| 153 | pub fn is_meta_character(c: char) -> bool { |
| 154 | match c { |
| 155 | '\\' | '.' | '+' | '*' | '?' | '(' | ')' | '|' | |
| 156 | '[' | ']' | '{' | '}' | '^' | '$' | '#' | '&' | '-' | '~' => true, |
| 157 | _ => false, |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | /// Returns true if and only if the given character is a Unicode word |
| 162 | /// character. |
no outgoing calls
no test coverage detected