Regex for find email only from given string

Hey @pankajs3

You can use below Regex-
(([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|([\w-]+\.)+)[a-zA-Z]{2,4}|[0-9]{1,3}\]?)

Reference Link - regex101: build, test, and debug regex

Above Regex will return you Groups just capture first group to get your email address from string.

Regards…!!
Aksh

1 Like