I just want to know how I can ammend this RegEx that I already have to not allow 2 dots like I example in the first post. I dont understand why 2 dots are allowed.
That is because if you use this with preg_match it will not work how you think...
It will return true as soon as it finds that matches the regular expression, even timvw1.2 would be valid.
Untested, but i think the following would be what you need:
Actually I am using eregi() to test the regex. So was my flaw leaving out the ^ at the start and $ at the end? It just seems odd to me that 2 dots are being accepted like this.
You are only testing if the regular expression is matched... So as soon as you had two numbers in the value, it would have been accepted... No matter where they were somewhere in the string..
With the ^ and $ you can enforce there is nothing "extra"
Man... I must live in like a 3rd dimension or something.. cause I copied the exact code you pasted into my script and it is still accepting 16..2 (2 dots). I cannot understand why. It is NOT accepting 9..2 thought... which is correct.. but why is it accepting 2 numbers and 2 dots is unreal, because I thought the ? is what says that the dot must either not come or only come once. I really appreciate your help tim.. especially taking the time to test in on your system. Unfortunatly the regex gods don't like my server. Not sure what to do.