upi id regex 1

upi id regex

/^\w.+@\w+$/.test('rishi.21@axis')

/^\w.+@\w+$/.test('shruti@PNB')

/^\w.+@\w+$/.test('98765__210@upi')

Here is what the above code is Doing:
1. ^ – Start of the string
2. \w – Matches any word character (alphanumeric & underscore)
3. .+ – Matches any character (except newline)
4. @ – Matches the character @ literally
5. \w+ – Matches any word character (alphanumeric & underscore)
6. $ – End of the string

Similar Posts