It is advisable to get clarifications on regular expressions. Who can explain why ^_ doesn’t work in the first block [] RegExp /^[\w^_\d-]+@([\w-^_]+\.)+[\w^_]{2,}$/
Something is starting to clear up. Thus, I expand the range of characters used , but the browser itself performs the check after @, ignoring my conditions. So I still need to master the “regexp” to figure out how to exclude a certain character from the range and much more…
In the solution, I left the check only for the first part of the address.
I don’t know if you updated your regex more, but it looks fine to me.
Instead of using a regex for the email I think its better to check if the field is valid (Let the browser check with type="email"). Have you looked into the Constraint validation API. That’s the suggested way to solve this exercise:
We would like you to use the constraint validation API, plus some form validation attributes, to program some custom error messages.
Yes, the “regular expression” was changed, but returned to the first value, the partial check does not work quite correctly.
For some reason, I was confused by the length check. After re-viewing “Validating forms using JavaScript” I changed the verification code. I hope that is correct.