Write a Regular expression to validate email address
^[a-zA – Z0 – 9. _%+-]+@[a-zA – Z0-9 . _%+-]+\.[a-zA-Z]{2,4}$
In the above example:
In the above example:
- the sequence ^[a-zA – Z0 – 9. _%+-] matches letters,digits,underscores,%,+ and -.
- The + (plus) sign after the 1st sequence means the string must include one or more of those characters
- Next the pattern matches @
- Then the pattern matches another letter one or more times followed by a . and then between two to four letters
No comments