onetrueawk / awk

One true awk
Other
1.98k stars 159 forks source link

awk: need to escape regexp delimiter (/) inside square brackets in a regex #140

Closed phillbush closed 2 years ago

phillbush commented 2 years ago

One True AWK needs the regexp delimiter / to be escaped even when between square brackets in a regexp.
In the image, I compare the following command in GNU awk, mawk, OpenBSD awk and One True AWK.
It works in all awk implementations, except in OTA.

awk 'BEGIN {s = "/"; sub(/[/]/, "a", s); print s}'

ota

plan9 commented 2 years ago

you should have visited previously closed issues, #135 and #81 this will not be fixed in onetrueawk for now. thanks