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 gawk syntax. It also works for patterns when there's no fixed text that can work as a record separator and doesn't match over linefeeds:
gawk
{ pattern = "([a-g]+|[h-z]+)" while (match($0, pattern, arr)) { val = arr[1] print val sub(pattern, "") } }