Formvalidtor of the regular expression in thinkphp--help
This post was last edited by wadelin511 on 2013-03-13 12:25:31
Use formvalidator-4.1.3.js for email format check.
This is written in the following way.
$ ("#email"). Formvalidator ({onshow: "Please enter the mailbox", onfocus: "Mailbox 6-100 characters, entered correctly to leave the focus", Oncorrect: "Congratulations, you lost the right", DefaultValue: " @ "}). Inputvalidator ({min:6,max:100,onerror:" The length of the mailbox you entered is illegal, please confirm "}). Regexvalidator ({regExp:" ^ ([ \\w-.] +) @ ([[[0-9]{1,3}. [0-9] {1,3}. [0-9] {1,3}.) | ([\\w-]+.) +)) ([a-za-z]{2,4}| [0-9] {1,3}) (]?) $ ", OnError:" The mailbox you entered is not in the correct format "});
Test normal in a static Web page. But in the thinkphp template file, the parsed code becomes the
REGEXP: "^ ([ \w-.] +) @ ([[[0-9]{1,3}. [0-9] {1,3}. [0-9] {1,3}.) | ([\\w-]+.) +)) ([a-za-z]{2,4}| [0-9] {1,3}) (]?) $"
Causes the Formvalidator "character set to cross out" issue.
Why the expression was changed. \\w became \w?
Please help us to confirm!
thinkphp Formvalidtor Character set out of bounds
------Solution--------------------
The template file is read into the variable, so \\w becomes the \w
To write \\\w or \\\\w
------Solution--------------------
This is not clear, need to see PHP C source code to analyze the reason
But it's not something anyone can do.
The actual use also do not have to delve into, encounter add a "\" not when you add one, so loop know not error
You can see a lot of code in foreign countries there will be four or five consecutive \