fix repetition with ANY

This commit is contained in:
Kyryl Melekhin
2021-09-30 09:21:49 +00:00
parent e3bede1739
commit f32e9c4478
2 changed files with 7 additions and 0 deletions

1
pike.c
View File

@@ -308,6 +308,7 @@ static int _compilecode(const char **re_loc, rcode *prog, int sizecode)
case RSPLIT: case RSPLIT:
case SAVE: case SAVE:
case CHAR: case CHAR:
case ANY:
i++; i++;
icnt++; icnt++;
} }

View File

@@ -121,6 +121,8 @@ aaaaa(aa)aa(aa(a)a)?aa
^\\\\.+(((/)\\\\.\\\\.+)+)? ^\\\\.+(((/)\\\\.\\\\.+)+)?
^(http|https|ftp):[/]{2}([a-zA-Z0-9\\\\\\\\.]+\\\\.[a-zA-Z]{2,4})(:[0-9]+)?/?([a-zA-Z0-9\\\\\\\\._?,'/+&%$#=~]*) ^(http|https|ftp):[/]{2}([a-zA-Z0-9\\\\\\\\.]+\\\\.[a-zA-Z]{2,4})(:[0-9]+)?/?([a-zA-Z0-9\\\\\\\\._?,'/+&%$#=~]*)
(\\\\$\\\\([a-zA-Z0-9_]+\\\\))|(([A-Za-z_%.]+):) (\\\\$\\\\([a-zA-Z0-9_]+\\\\))|(([A-Za-z_%.]+):)
.{5}
.{10,15}
" "
input="\ input="\
abcdef abcdef
@@ -243,6 +245,8 @@ aaaaaaaaaaaaaaaaaaaaaaaaa
../../.. ../../..
https://kyryl.tk/404 https://kyryl.tk/404
OBJ = \$(SRC:.c=.o) OBJ = \$(SRC:.c=.o)
рврыр
рврырdhsjhh
" "
expect="\ expect="\
(0,3) (0,3)
@@ -365,6 +369,8 @@ expect="\
(0,8)(2,8)(5,8)(5,6) (0,8)(2,8)(5,8)(5,6)
(0,20)(0,5)(8,16)(?,?)(17,20) (0,20)(0,5)(8,16)(?,?)(17,20)
(8,12)(?,?)(8,12)(8,11) (8,12)(?,?)(8,12)(8,11)
(0,10)
(0,16)
(0,0) (0,0)
" "