"/^(\d{1,7})\.(\d{1,2})$/"
If you're testing a string you want to set the anchors "^" (beginning of string) and "$" (end of string) so you know that there is nothing else in between. "/(\d{1,7})\.(\d{1,2})/"
will match 12345678.12
because it is matching, take a look at this.
without ^$
__________
1|2345678.12|
----------
that's 7 numbers a decimal and 2 numbers, so a match
with anchors
_______
|1234567|8.12
-------
no match