MCPcopy Create free account
hub / github.com/davidblewett/rure-python / is_meta_character

Function is_meta_character

regex/regex-syntax/src/lib.rs:153–159  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
153pub 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.

Callers 3

escape_intoFunction · 0.85
parse_escapeMethod · 0.85
write_literal_charMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected