/^(\w){8,50}$/
This is a regular pattern for 8 to 50 alphanumeric underscores. Now we need to add support for all special symbols (such as %@, etc.) , how to modify
仅有的幸福2017-06-12 09:30:59
/^[w%@]{8,50}/
Just put the special characters you need to add into the []
character set. []
means matching any element in it.