I've created a regular expression in JavaScript to validate email addresses.
/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
Currently, I have implemented client-side validation in my project. However, based on a recommendation, I am looking to add server-side validation as well.
This is the modified version of my regex in C#:
@"^([A-Za-z0-9]([-._\w]*[0-9a-zA-Z])*@([A-Za-z0-9][-\w]*[A-Za-z0-9]\.)+[A-Za-z]{2,9})";
I want the C# code to function exactly like the JavaScript code.
If anyone can assist me in making this adjustment, it would be greatly appreciated.
p.s: If this platform is solely for criticizing rather than helping with technical questions (as has been my experience in recent months), please guide me to a more supportive community for basic assistance.