Code: Select all
Alias:
^boilp ((\d+)\s)?(\w+)$
Script:
echo("\n 1: " .. matches[2])
echo("\n 2: " .. matches[3])
echo("\n 3: " .. matches[4] .. "\n")
It is my understanding that using the optional ? character around a capture group should not change the number the other capture groups are assigned to, should that optional value not be present in the string..boilp 23 health
1: 23
2: 23
3: health
boilp health
1: health
In other words, the expected output was:
1:
2:
3: health
In fact, it is my understanding that in the past in Mudlet - it worked as expected. I can say with absolute certainty that regexp in CMUD works this way.
I'm confused!