The problem is that "." matches any character in regexes, so
/1.2.3/
Actually means
match "1" followed by any character then "2" then any character then "3" . What others suggested is to escape the dots so that they only match dots, using the different ways available (because of course TIMTOWTDI).
By the way if you need to try out your regexes in an easy and graphical way, I advise you to try the wonderful script regexperiment from paul Gaborit, I use it a lot and it saved me much time and effort.