Your regex is technically incorrect. You can't have a +
after a {,}
qualifier, it's like saying .*+
or .?*
(the +
is a special metacharacter in regex meaning "one or more", just like *
means "zero or more").
Try
^[-+]?[0-9]{1,3}(\.[0-9]{1,2})$
Notice the {1,3}+
is just a {1,3}
.