The non-word character class \W doesn’t contain all the characters necessary to successfully capture what you’re looking for. You could change \W+ to . and it should capture everything after echo.
I tried what you suggested, not sure if I am doing something really stupid, date1 still turns up empty, but other regex’s work in the same statement. I have included one that works below as well:
I am trying to read a text file, and get the date part which is part of a string containing “echo”. This is then going to be assigned to date1 as part of a select statement along with other values read from the text file. part of the code below. It is to date1 that I am trying to read this string into: