Created
November 17, 2014 22:57
-
-
Save mayjs/124010ec649dbe7265e0 to your computer and use it in GitHub Desktop.
Useful regular expressions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\d+ Checks for positive (unsigned) integers | |
-?\d+ Checks for positive and negative (signed and unsigned) integers | |
-\d+ Checks for negative (signed) integers | |
-?\d*(\.\d+)? Checks for positive and negative decimals. | |
-?\d*(\.\d{n})? Checks for positive and negative decimals with precision n. | |
-?\d*(\.\d{n,m})? Checks for positive and negative decimals with a precision between n and m | |
-?\d*(\.\d{n,})? Checks for positive and negative decimals with a precision greater then or equal to n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment