问题描述:

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;
相关阅读:
Top