I want to know if by using regular expressions I am able to extract emails from the following strings?
The following RE pattern is .*@.*
match with all st
[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_.]+
worked for me, you can check the result on this regex101 saved regex.
It's really just twice the same pattern separated by an @
sign.
The pattern is 1 or more occurences of:
a-z
: any lowercase letterA-Z
: any uppercase letter0-9
: any digit-_.
: a hyphen, an underscore or a dotIf it missed some emails, add any missing character to it and it should do the trick.
Edit
I didn't notice it first, but when going to the regex101 link, there's an Explanation section at the top-right corner of the screen explaining what the regular expression matches.