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:
@ -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
|
||||
|
Reference in New Issue
Block a user