If you want to register a regular expression match, or if there is a "..." before it, you cannot register it.
Username: "^ \ w + $", // used for user registration. Match the string username1 consisting of digits, 26 English letters, or underscores: "^ (\ w +) | ([\ u4E00-\ u9FA5 \ uF900-\ uFA2D] +) $ ", // used for user registration, supports Chinese characters
If you want to register a regular expression match, or if there is a "..." before it, you cannot register it.
Reply to discussion (solution)
So you can provide a regular expression that can meet the registration requirements?
$p='/^\.\.|\.\.$/';
Regular expressions are not required. Regular expressions are not required if string functions are used.
$ Str = "... zh... ddjjdd ..";
$ User_left = substr ($ str, 0, 2 );
$ User_right = substr ($ str,-2 );
If ($ user_left = '..' & $ user_right = '..'){
Echo "invalid user name ";
} Else {
Echo "legal user ";
}
In this way, you can
Regular expressions are not required. Regular expressions are not required if string functions are used.
$ Str = "... zh... ddjjdd ..";
$ User_left = substr ($ str, 0, 2 );
$ User_right = substr ($ str,-2 );
If ($ user_left = '..' & $ user_right = '..'){
Echo "invalid user name ";
} Else {
Echo "legal user ";
}
In this way, "..." can be followed or in front of it & should be changed to |, or
Regular expressions are not required. Regular expressions are not required if string functions are used.
$ Str = "... zh... ddjjdd ..";
$ User_left = substr ($ str, 0, 2 );
$ User_right = substr ($ str,-2 );
If ($ user_left = '..' & $ user_right = '..'){
Echo "invalid user name ";
} Else {
Echo "legal user ";
}
In this way, "..." can be followed or in front of it & should be changed to |, or
Sorry, you are careless when writing examples. either or | yes.
According to his writing requirements, it seems that English numbers, underscores, common Chinese characters, and some full-angle symbols are allowed.