Fix escape check for escaped backslash

This commit is contained in:
RumovZ 2020-11-15 11:57:11 +01:00
parent 63cc877023
commit ae01a5b3a2

View file

@ -447,8 +447,9 @@ fn unescape_quotes(s: &str) -> Cow<str> {
fn is_invalid_escape(txt: &str) -> bool { fn is_invalid_escape(txt: &str) -> bool {
// odd number of \s not followed by an escapable character // odd number of \s not followed by an escapable character
lazy_static! { lazy_static! {
static ref RE: Regex = Regex::new(r#"(^|[^\\])(\\\\)*\\([^":*_()]|$)"#).unwrap(); static ref RE: Regex = Regex::new(r#"(^|[^\\])(\\\\)*\\([^\\":*_()]|$)"#).unwrap();
} }
RE.is_match(txt) RE.is_match(txt)
} }