I use this preg_match condition for matching positive, negative and decimal values
/^[0-9,-\.]{1,50}$/
But when I enter –34.000 it does not show error, when I enter 34…9868 it does not show error,
what I want is that it must accept only positive, negative and decimal values.
try this regex
^-?\d*\.?\d+$i suppose it however cannot be limited to 50 chars