0

I want to create a regular expression for a RegularExpressionValidator in Asp.net...

I want to create the following expression

(emailaddress ([,][SPACE]* emailaddress)* )?

emailaddress = \w+([-+.']\w+)@\w+([-.]\w+).\w+([-.]\w+)*

please check if emailaddress is correct, and how can I create the syntax for the above expression thank you

1

2 Answers 2

1

Building on Using a regular expression to validate an email address,

ValidationExpression="(?:(?:^|,\s*)[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})\s*)+"
Sign up to request clarification or add additional context in comments.

Comments

1

you can try with

ValidationExpression="^(([^<>()[\]\\.,;:\s@\""]+"

                        + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@"

                        + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"

                        + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+"

                        + @"[a-zA-Z]{2,}))$"

You can use this site in order to create your regex : RegexHero

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.