How do I perform action on all matching groups when the pattern matches multiple times in a line?
To illustrate, I want to search for /Hello! (\\d+)/ an
/Hello! (\\d+)/
This is a simple syntax, and every awk (nawk, mawk, gawk, etc) can use this.
{ while (match($0, /Hello! [0-9]+/)) { pattern = substr($0, RSTART, RLENGTH); sub(/Hello! /, "", pattern); print pattern; $0 = substr($0, RSTART + RLENGTH); } }