Open eggert opened 7 months ago
thanks - will fix. I understand the problem, but won't get to this for a few weeks (currently improvements to mawk are behind several other programs).
mawk 'BEGIN { if ("aaa" ~ /^a{2,5}$/) print "ok" }'
fails as well
This doesn't look right either.
$ echo 'x xx ' | mawk '{sub(/(x+ +){2}/, "y")} 1'
yxx
I found this problem while trying to use mawk to implement tzselect, an awk-using program that's part of tzcode. To reproduce the bug, run this shell command:
This should output "ok" but does not, because the regular expression
^a{2,}$
incorrectly matches onlyaa
.I found the problem on mawk 1.3.4 20230730 as distributed by Ubuntu 23.10. The problem is still present in mawk 1.3.4 20231126 which I compiled myself.