Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey people,

I am confused by that example that was written for e-mail validation.

Check it:
Regex regex = new Regex(@".*@.{2,}\..{2,}");

What is that {2,}?

UPDATE:
Resolved by OP himself.
Posted
Updated 24-Jan-11 1:38am
v3

1 solution

problem solved....2 denotes there minimum match


for example
Regex regex = new Regex(@".*@.{10,}\..{2,}");
unforgiven@metallica.com metallica there is 9 character.its not gonna match.

but it will be matched when Regex regex = new Regex(@".*@.{9,}\..{2,}") is defined like that.
 
Share this answer
 

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