I have an ASP.NET 4.0 MVC app in C# and I need to create a regex that will match N{3}.N{3}.N{3}.{N{3} where N{3} is any 1, 2, or 3 digits(0-9) e.g.
1.1.1.1
111.111.111.111
1.111.111.1
I have tried
@"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"
but this matches things I don't want it to like
111.1.1
1111.1.1
What am I doing wrong?