REGEXTEST gives strange results
So I'm using a regex for version numbers since I want everyone to use the same format and not one person writing "Version 1" and another "1.0". My regex for this is "^(\d+\.)+\d+$" and it accepts version numbers like "1.0" or "2.0" or "1.0.3.5" but for some reason gives an error message when there's no 0 after the first period like "1.2" or "2.7". Except when the first number is a zero like "0.8".
I have absolutely no idea why this happens. I've also tried different variations of this regex like replacing \d with [0-9] or leaving out the start and beginning symbols but nothing changed. All online regex editors say my regex should be correct and the company AI also can't find any issues with it.
Does anyone know why the hell this is happening?
[link] [comments]
Want to read more?
Check out the full article on the original site