POSIX character regular class in PHP

Source: Internet
Author: User
[: Alnum:]: character [: alpha:]: character [: digit:]: digit character [: graph:]: non-empty characters (non-space, control characters) [: lower:]: lowercase character [: cntrl:]: Control Character [: print:]: non-empty characters (including spaces) [: punct:]: punctuation [: space:]: All blank characters (new line, space, Tab

[: Alnum:]: character [: alpha:]: character [: digit:]: digit character [: graph:]: non-empty characters (non-space, control characters) [: lower:]: lowercase character [: cntrl:]: Control Character [: print:]: non-empty characters (including spaces) [: punct:]: punctuation [: space:]: All blank characters (new line, space, Tab

[: Alnum:]: Numbers and characters

[: Alpha:]: text character

[: Digit:]: digit character

[: Graph:]: non-null characters (non-space, control characters)

[: Lower:]: lowercase character

[: Cntrl:]: Control Character

[: Print:]: non-empty characters (including spaces)

[: Punct:]: punctuation

[: Space:]: All blank characters (new lines, spaces, and tabs)

[: Upper:]: uppercase characters

[: Xdigit:]: hexadecimal number (0-9, a-f, A-F)

When using the tool, remember to enclose the braces [] on the outside.

For example

Preg_replace ('/[: punct:]/I', '', $ message );

Original article address: POSIX character regular class in PHP. Thanks for sharing it with the original author.

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.