Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi,
i want to validate cc,bcc for sending email(mails seperated by ,).presently i am using the below code to validate

<stringlengthvalidator(0,2000)> _
        <validatorcomposition(microsoft.practices.enterpriselibrary.validation.compositiontype.or)> _
        <regexvalidator("^(\s*,?\s*[0-9a-za-z]([-.\w]*[0-9a-za-z])*@([0-9a-za-z][-\w]*[0-9a-za-z]\.)+[a-za-z]{2,9})+\s*$",MessageTemplate:="EmailObject_009")> _
        Public Property MailBCC() As String


Here it is not working if i keep only 0 and remove 2000 then it is working fine .but i want to check upper boundaryrange also ...

how should i do this...
Posted
Updated 31-Oct-13 23:23pm
v5

1 solution

Try this site.

Regex Tester[^]

Your regular expression:
^(\s*,?\s*[0-9a-za-z]([-.\w]*[0-9a-za-z])*@([0-9a-za-z][-\w]*[0-9a-za-z]\.)+[a-za-z]{2,9})+\s*$

Your test string:
bhuvan2001@gmail.com

If the Entered mail ID or contect is not matching then shows ["No Match Found"], so we have to change the expression to validate as per our requirement.

If the pattern & Entereted content matches, then it will display all possible values that can accept.
 
Share this answer
 
Comments
pullareddy S 1-Nov-13 5:23am    
Thanks for your reply.
in my requirement regular expression is working fine for (,)seperated emails..
but in first line i wrote <stringlengthvalidator(0,2000)> _
in second line i wrote (or condition)
in 3rd line i wrote regularexpression validator
here Expression is fine but when there is some text like "aaaaa" it should validate there.
but because of (or condition), the text is in between 0-2000 is TRUE.so even next it is not validating expression....
For me in cc even the text is nothing.
but if the text is there in cc .it should check Expression..How to do this please...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900