02-06-2022, 09:32 AM
Hi,
I'm experimenting a quite weird behaviour of this very simple regex:
Macro Macro40
it SHOULD give a match but it doesn't:
But if I change the character class negating the opposite of the ones I want to match, it works:
Macro Macro40
If I test the regex onĀ https://regex101.com (PCRE engine) it works, and so it does in RegexBuddy.
Negating the opposite could be a workaround, but is there a way to make character class working as expected?
Am I doing things wrong?
many thanks
I'm experimenting a quite weird behaviour of this very simple regex:
Macro Macro40
out
;str r = "433\.[^4567]1"
str r = "433\.[012389]1"
str c = "433.21"
str t
ARRAY(str) ris
if(findrx(c r 0 2 t)>=0)
,out t
else
,out "no match"
it SHOULD give a match but it doesn't:
But if I change the character class negating the opposite of the ones I want to match, it works:
Macro Macro40
out
str r = "433\.[^4567]1"
;str r = "433\.[012389]1"
str c = "433.21"
str t
ARRAY(str) ris
if(findrx(c r 0 2 t)>=0)
,out t
else
,out "no match"
If I test the regex onĀ https://regex101.com (PCRE engine) it works, and so it does in RegexBuddy.
Negating the opposite could be a workaround, but is there a way to make character class working as expected?
Am I doing things wrong?
many thanks