Is it a positive table? String can only contain English ,? Word, bottom ?? And ""

Source: Internet
Author: User
Is it a positive table? String can only contain English ,? Word, bottom ?? And? Is there a string to be judged ?, A string can only contain English letters, question marks, and question marks ,? Word, bottom ?? And "\",??? How ?? Formal table? ,??.


Reply to discussion (solution)

/^ [\ W \] + $/

/^ [\ W \] + $/



Hi, I used it ?? Method, but the program ?? Now, Ma ?? Look

Echo" ";
Function ispassword ($ str ){

If (preg_match ('/^ [\ w \] + $/', $ str )){
Return true;
} Else {
Return false;
}
}
$ Password = 'This _ is_test _ \ thisstr ';
If (ispassword ($ password )){
Echo 'conformances ';
} Else {
Echo 'nonconformity ';
}

?>

Program ?? :(! ) Warning: preg_match () [function. preg-match]: Compilation failed: missing terminating] for character class at offset 8

Can I change if (preg_match ('/^ [\ w \] + $/', $ str? If (preg_match ('/^ [\ w \] + $/', $ str ))? The operation is normal. Are you missing? \ Why?

Yes
This is related to the php version.

Yes
This is related to the php version.



?? Moderator ..??..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.