I am searching for a way to retrieve all emails addresses from a given string.
For example: if i have the string “AB CD [ABCD@gmail.com]” i want to receive only “ABCD@gmail.com”.
I guess i should use RegExp and String match function, but i am not sure how.
Any ideas?
String.matchis indeed the way to go:This uses a regex to match a RFC2822 from the community regexes of regexr.