Originally Posted By: Wims
Your loop is very inefficient
You should point out the inefficiency that you think my example should be improved upon. It's a polite gesture to explain without dropping a line in an in-your-face manner.

I know there are -r, -s and -w switches, but a loop is required or it will only return one result. I was borrowing the regex engine to match strings in the test.txt.