I am looking to trim a string that will be created from reading in a file line by line. However i want to pull out only the email from the string, but it will change every time. The only contant is the domain, for example @domain.com.
So for the input string of
00:00:50,004 ERROR [SynchronousCallback] Cannot process resource: test.test@domain.com Channel: channel16
What regular expression will look for @domain.com and pull out all test.test@domain.com. Ive got a regex that will look for the string m/@domain.com/i but i dont know how to then manipulate the string once the @domain.com has been located in the whole string.
The output i would like would be just the email test.test@domain.com
Output: