I have two regular expressions that I need to combine into one since I use RegularExpressionAttribute in ASP.NET and it does not allow multiple instances.
How can I attach the following two regular expressions to one?
.* ?@ (?!.*?\.\.)[^@]+$ [\x00-\x7F]
the first checks that there are no two consecutive points in the domain part of the message, and the second regular expression checks that all ascii characters
I thought it would be as simple as combining them together as (.* ?@ (?!.*?\.\.)[^@]+$)([\x00-\x7F]) , but this does not work.
Here is the link to the previous post related to this issue
EDIT . I decorate the string property of my view model using the reglarexpression attribute, and this turns into javascript using unobtrusive, so it should check for javascript usage. I did not mention this in my initial post
source share