Check out example codes for "how to match email in regex in ruby". It will help you in understanding the concepts better.

Code Example 1

VALID_EMAIL_REGEX = /\A[\w+\-.][email protected][a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i

Learn ReactJs, React Native from akashmittal.com