The ^ symbol in your regex means "assert position at start of the string".
Therefore in this case you shouldn't use it in the middle of your regex - you're saying
"first allow a plus or minus"
"then allow a period ."
then the string starts
which isn't going to work. Take out the ^ symbols - except maybe put one at the very start to genuinely assert the start of the string.
You end up with:
This regex will validate numerics with and without preceding +- symbol, and with/without a period e.g.:
Even this isn't a great regex though - because it *will* validate "0.8.8" (two periods) which isn't a valid number.
will validate negative and positive decimals to 2 decimal places: taken from Stack Overflow Link
edit: wow - three solutions in the time it took me to type this :)