Title |
Test
Find
Pattern Title
|
Expression |
^[-+]?\d*$ |
Description |
Matches any integer number or numeric string, including positive and negative value characters (+ or -). Also matches empty strings. |
Matches |
123 | -123 | +123 |
Non-Matches |
abc | 3.14159 | -3.14159 |
Author |
Rating:
Steven Smith
|
Source |
|
Your Rating |
|
Title: Ensure +/- signs are not allowed without a number following
Name: Graham
Date: 11/20/2020 10:16:45 PM
Comment:
To ensure that a number must follow the sign to fix Lindsay's comment
^[-+]?\d+$
Title: Allow alpha chars
Name: Patricio
Date: 2/25/2011 12:56:59 PM
Comment:
This expression allows alpha chars in the first position like "a" or another char.
Title: Doesn't require a number
Name: Lindsay
Date: 9/13/2004 7:07:02 PM
Comment:
This regular expression allows '-' by itself. :(