PHP Regular Expression special characters "[]" and "", then what are they? What is the specific operation? They are special characters, so what is the special place in the use process? Let's take a look at the specific introduction.
There are also two very important special characters that are "[]". They can match the characters that appear in "[]", such as "/[az]/" can match a single character "a" or "Z", if the above expression is changed to such "/[a-z]/", you can match any single lowercase letter, such as "A", "B" and so on.
About PHP Regular expression special characters "[]":
If "^" appears in "[]", it means that this expression does not match the characters appearing in "[]", such as "/[^a-z]/" does not match any lowercase letters! And the regular expression gives the default values of several "[]":
[:alpha:]: Matches any letter
[:alnum:]: Matches any letter and number
[:d Igit:]: Matches any number
[:space:]: Match whitespace
[:upper:]: matches any uppercase letter
[:lower:]: matches any lowercase letter
[:p UNCT:]: matches any punctuation
[:xdigit:]: Matches any 16 binary digits
About PHP Regular expression special characters "":
The following special characters are represented by the escape symbol "" after escaping the following meanings:
S: matches individual whitespace
S: Used to match all characters except a single space character.
D: Used to match numbers from 0 to 9, equivalent to "/[0-9]/".
W: Used to match letters, numbers, or underscore characters, equivalent to "/[a-za-z0-9_]/".
W: used to match all characters that do not match W, equivalent to "/[^a-za-z0-9_]/".
D: Used to match any numeric characters that are not 10 binary.
.: Used to match all characters except the newline character, if the modifier "s" is decorated, "." can represent any character.
Introduction to the special characters of the PHP regular expression is introduced to you here, I hope that it is helpful to you to understand and master the use of PHP regular expression special characters.
http://www.bkjia.com/PHPjc/446588.html www.bkjia.com true http://www.bkjia.com/PHPjc/446588.html techarticle PHP Regular Expression special characters "[]" and "", then what are they? What is the specific operation? They are special characters, so what is the special place in the use process ...