The behavior is explained here: http://www.gnu.org/software/gawk/manual/gawk.html#Gory-Details
From that link it can be seen that the there is a difference in behavior depending upon
- which version of
awk
you are using, and - if you use
gensub()
orsub()