Regular PHP
if (Preg_match ("^[a-za-z][a-za-z0-9_\-]{5,19}$", "abc-mmm"))
echo "true";
else echo "false";
?>
Want to verify the regular expression of the account, the beginning of the letter, allow numbers, letters, underscores, minus, 6-20 for, why the expression is not successful AH?
Warning:preg_match () [Function.preg-match]: No ending delimiter ' ^ ' found in test.php on line 3
False
Tried "^[a-za-z][a-za-z0-9_-]{5,19}$", take off "\" is not right, ask God to know (UTF8 format)
Reply to discussion (solution)
Preg_match ("/^[a-za-z][a-za-z0-9_-]{5,19}$/", "Ml-virgil"))
Just tried to add "/" on the line, this is why? I am a novice php do not understand, seek the guidance of the Great God
That's called the delimiter. Without delimiters, PHP would assume that ^[a-za-z][a-za-z0-9_-]{5,19}$ is a string, not a variable.
We often call "\" called "Skipping character", which is used to escape some special symbols.
That's called the delimiter. Without delimiters, PHP would assume that ^[a-za-z][a-za-z0-9_-]{5,19}$ is a string, not a variable. So ah, that ask the big God a question, I put the English and Chinese with "\ n" connected to the mysql,php code and MySQL are utf-8 why in Phpadmin found is "0", data type is text? Troubled me for a long time ah ...
Done, the SQL statement problem, really careless. Knot sticker, please.