Problem
Judge the regular expression of the user name
Solution
Preg_match ('/^ \ s * $ | ^ c: \ con $ | [%, \ * \ "\ s \ t \ <\> \ & '\]/', $ username)
How Can I copy the code?
Thank you!
Copy the PHP content to the clipboard. PHP code: [%, * "\ s \ t \ <\> \ & '\]
This part can be basically understood, *, double quotation marks, space characters, tabs, less than, greater than, &, single quotation marks, but why use two backlash?
What do we mean by the last four backslash lines?
[]
Reference answer
[Img] http://www.111cn.cn/bbs/images/smilies/default/funk.gif#/img]
Reference answer
The user name is prohibited from being signed. Blank characters and line breaks.
It seems that the regular expression author is a little abnormal.
Reference answer
I don't know much.
^ \ S * $ | ^ c :.
^
Why use two \ s?
C:
What does it mean?
Reference answer
/^
The most strange thing is here. ^ put it in the middle of the expression. I really don't think of what it means ..
Reference answer
\ S *
Why should we use two \
This is a single quotation mark. Simply say one is enough.
Reference answer
Du Jiang's book has said that \ s \ t \ r all have...
Reference answer
Can't you answer this question in front of me? [img] http://www.111cn.cn/bbs/images/smilies/default/42.gif#/img]
Reference answer
\ Con what is this?
Reference answer
Can you tell me what you know?