Sorry Guys, I can see my question and code was not clear at all. I did not copy and paste the actual code I thought I would try to boil it down to its most simple form. my string is not "major.minor.build.revision"
My string would literally look like this
$mystring = "gouda.usa.texas.dallas";
I am using Config::Inifiles in fictitious dosumpton and validation would take there because if Section and Parameter are not in the config file then I will add default data or kill the job based on other parameters passed to dosumpton. dosumpton takes many more parameters than shown.
I just wanted to know what corner cases the algorithm would miss. As a blue collar or more appropriately shadetree developer the algorithm is where I tend to have more short commings.