Last active
October 7, 2015 09:26
-
-
Save davidbarredo/6e00da8f18361302409c to your computer and use it in GitHub Desktop.
Util 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
//for positive integers | |
/^\+?[1-9]\d*$/.test(); | |
//for positive integers and zero | |
/^\+?(0|[1-9]\d*)$/.test(); | |
//for positive/negative integers and zero | |
/^\-?(0|[1-9]\d*)$/.test(); | |
//to match specific chars | |
/[`~!@#$%^&*()_|+\-=÷¿?;:'",.<>\{\}\[\]\\\/]/.test(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment