Click here to Skip to main content
15,919,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using the following RegEx \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* to validate Email. In that i need to restrict the user to enter at-least 2 characters after the (dot) (i.e : raks_laps.cv ) part.how can i change the number of characters to that?


Regards,
hsakarp.
Posted
Comments
Maciej Los 16-Aug-13 3:22am    
Please, do not repost!
http://www.codeproject.com/Questions/637969/increase-the-number-of-characters-after-dot-in-Ema
Instead posting new qestion, please, use "Improve question" widget.
hsakarp 16-Aug-13 7:13am    
Sure Maciei , that happened by mistake.:)

Maciej Los 16-Aug-13 7:20am    
OK ;)

There are a couple of ways to do this: you could change the final "\w+" to "\w\w+", or you could use use "\w{2,}" instead.
 
Share this answer
 
Thanks OriginalGriff,I have changed the format to ^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+[.])*(\.[a-zA-Z]{2,4})$.But i cant able to test the below mentioned format as valid.COuld you please modify the regEx.

Formats:
VB
Valid: js#internal@proseware.com
Valid: j_9@[129.126.118.1]



Regards,
Hsakarp
 
Share this answer
 
v2

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