regex adjustment for mawk compatibility on Debian/Ubuntu
updated version