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

regex: improve errors for edge cases (#13008)

* code cleaning, added more clear errors for dots and ORs

* added failed match index for better find functions, updated tests

* added index in match failed, updated tests

* test cleaning

* test check
This commit is contained in:
penguindark
2022-01-01 08:21:27 +01:00
committed by GitHub
parent 7b4ba66720
commit 908296cdfb
3 changed files with 41 additions and 52 deletions

View File

@ -272,8 +272,14 @@ pub fn (mut re RE) find_all(in_txt string) []int {
i += e
continue
}
/*
if e > 0 {
i += e
continue
}
*/
i++
}
i++
}
// re.flag = old_flag
return res
@ -306,6 +312,12 @@ pub fn (mut re RE) find_all_str(in_txt string) []string {
continue
}
}
/*
if e > 0 {
i += e
continue
}
*/
i++
}
// re.flag = old_flag