Negative Number Regular Expression

Category: Numbers

A regular expression to match a negative number like -100, -200.5, etc.

/^-\d*\.?\d+$/

If you’re looking for a regular expression to match negative integers, use this regex instead:

^-\d+$

See Also:

Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.