You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Bug occurs in the vlang regex module , with the following: [^/]+. (and pretty sure also with the * instead + ; not tested more)
Reproduction Steps
importregexfnmain() {
re:= regex.regex_opt(r'^/admin/[^/]+$') or { panic(0) }
if re.matches_string('/admin/something') {
//should matchprintln('This is ok and should match!')
}
if re.matches_string('/admin/') {
//should NOT matchprintln('This should not be matched...')
}
if re.matches_string('/admin') {
//should NOT matchprintln('This is not matched tho...')
}
}
Expected Behavior
Im expecting to match everything except slash (/)
So this should be matched: /admin/something or this /admin/124
This should not (!) be matched: /admin/, /admin, /admin/something/other
Current Behavior
/admin/ is getting matched but no character is provided behind the last slash so why is this matching (?)
Possible Solution
I have no idea but maybe it has something todo with the piviot ? Because it is used for negation + for marking the "start of a string".
Additional Information/Context
This is my regex: ^/admin/[^/]+$
But its also not working without the $ and without the first ^...
I tried with flags aswell, like this rg_bin or how its called again and so on.
V version
0.4.2 1c4c505
Environment details (OS name and version, etc.)
ZorinOS 16.3 (Linux, Debian/Ubuntu based)
64 Bit AMD Ryzen 5xxx-laptop CPU
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered:
Describe the bug
This Bug occurs in the vlang regex module , with the following:
[^/]+
. (and pretty sure also with the * instead + ; not tested more)Reproduction Steps
Expected Behavior
Im expecting to match everything except slash (
/
)So this should be matched:
/admin/something
or this/admin/124
This should not (!) be matched:
/admin/
,/admin
,/admin/something/other
Current Behavior
/admin/
is getting matched but no character is provided behind the last slash so why is this matching (?)Possible Solution
I have no idea but maybe it has something todo with the piviot ? Because it is used for negation + for marking the "start of a string".
Additional Information/Context
This is my regex:
^/admin/[^/]+$
But its also not working without the $ and without the first
^
...I tried with flags aswell, like this rg_bin or how its called again and so on.
V version
0.4.2 1c4c505
Environment details (OS name and version, etc.)
ZorinOS 16.3 (Linux, Debian/Ubuntu based)
64 Bit AMD Ryzen 5xxx-laptop CPU
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: