3 ms·
I recently saw someone on StackOverflow asking for something similar: access, from the condition-action body, to the text which matched the regex. So I added a
by kazinator 4y ago
I recently saw someone on StackOverflow asking for something similar: access, from the condition-action body, to the text which matched the regex.
So I added a feature to the TXR Lisp awk macro. There is now an Awk variable called res which holds the result of the condition. If the condition is a regex, then that has the matching part. The fact that the action is executing tells us that the result of the condition is true; but res gives us the specific true value, like the it in anaphoric if macros.
This made it into release 284.