scanner: fix single backslash in raw string (#10890)

This commit is contained in:
Daniel Däschle 2021-07-22 16:02:11 +02:00 committed by GitHub
parent b537c9f624
commit ed234188b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -292,7 +292,7 @@ fn (mut ad AnchorData) add_link_targets(line_number int, line string) {
}
}
} else {
query := r'<a\s*id=["\'](?P<link>[a-z0-9\-\_\x7f-\uffff]+)["\']\s*/>'
query := '<a\\s*id=["\'](?P<link>[a-z0-9\\-\\_\\x7f-\\uffff]+)["\']\\s*/>'
mut re := regex.regex_opt(query) or { panic(err) }
res := re.find_all_str(line)