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

regex: fix a bug #7559 (#7601)

This commit is contained in:
penguindark 2020-12-27 08:16:00 +01:00 committed by GitHub
parent 1383771423
commit 1b9d514275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -1998,7 +1998,7 @@ pub fn (mut re RE) match_base(in_txt byteptr, in_txt_len int ) (int,int) {
}
// check if we must continue or pass to the next IST
if next_check_flag == true {
if next_check_flag == true && re.prog[state.pc+1].ist != ist_prog_end {
//println("save the state!!")
re.state_list << StateObj {
group_index: state.group_index

View File

@ -141,6 +141,7 @@ match_test_suite = [
// particular groups
TestItem{"ababababac", r"ab(.*)(ac)",0,10},
]
)
@ -256,6 +257,18 @@ find_all_test_suite = [
r"[Tt]o\w+",
[0, 5, 24, 32],
['Today', 'tomorrow']
},
Test_find_all{
"pera\nurl = https://github.com/dario/pig.html\npippo",
r"url *= *https?://[\w./]+",
[5, 44],
['url = https://github.com/dario/pig.html']
},
Test_find_all{
"pera\nurl = https://github.com/dario/pig.html\npippo",
r"url *= *https?://.*"+'\n',
[5, 45],
['url = https://github.com/dario/pig.html\n']
}
]
)