Hello i need a regular expression for an empty string or a string with punct,alnum,and digit.
i try something like this but it doesn't work; what are my errors???
Thx for help
var regularExp=/(^$ || ^[[:alnum:][:punct:][:space:]]{80}$)/i;
Javascript regex cannot use POSIX character class as you're trying. Unfortunately it doesn't also support PCRE classes.
You can probably use:
var regularExp = /^([a-z0-9\.,-\/#!$%' "^&*;:{}=_`~()-]{80})?$/ig;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With