I'm trying to find a certain sequence in the text of several .txt files. I am looking for a string that is joined to a 4 digit number. e.g. Watson1990. I tested the regex using an online tester and it appeared to work, however the expression (or combinations of it) failed to produce an output on my files.
My regular expression is as follows:
egrep '\w*\d{4}' *.txt
However it does not produce any output. Can you tell me what is wrong with this? I'm using OSX (Snow Leopard).
Thanks.