I have the following:
if (/0\.0$/.test(text))
I am using this successfully to check for text ending in 0.0 such as:
1.0.0
2.0.0
3.0.0
However it also works for the following:
1.10.0
2.10.0
Is there a way I can change this expression so it only gives true for the first 3 values and not the second two?
Here’s my complete code:
if (/0\.0$/.test(text))
pad = 10;
else if (/\.0$/.test(text))
pad = 35;
else
pad = 60;
tdToPad.css('margin-left', pad);
For the case where text is 2.10.0 it should pad with 35 but it is padding with 10.
Is there a problem with using
/\.0\.0$/?