1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

regex: fix simple char match (#17701)

This commit is contained in:
Felipe Pena
2023-03-20 05:37:09 -03:00
committed by GitHub
parent 74eac1de4e
commit 17fe76368a
2 changed files with 25 additions and 1 deletions

View File

@@ -2516,8 +2516,13 @@ pub fn (mut re RE) match_base(in_txt &u8, in_txt_len int) (int, int) {
// println("ist_quant_n no_match_found")
result = regex.no_match_found
m_state = .stop
// stop already started matching outside a capturing group
if re.state_list.len > 0 && re.state_list.last().group_index == -1
&& re.state_list.last().last_dot_pc > 0 {
return regex.no_match_found, 0
}
continue
// return no_match_found, 0
}
// ist_quant_p => quantifier positive test on token
else if m_state == .ist_quant_p {