The use of the PHP regular expression positioning characters is often encountered during the development process, then the specific type of PHP regular expression positioning characters have what? What exactly do they represent? Let's start by introducing each.
The role of the PHP regular expression positioning character:
The PHP regular expression positioning character is a very important type of character in the PHP regular expression, and its main function is to describe the position of the character in the matching object.
The type and meaning of the PHP regular expression positioning character:
^:
Indicates that the matching pattern appears at the beginning of the matching object (and differs in "[]")
$:
Indicates that the matching pattern appears at the end of the matching object
Spaces
Represents one of the two boundaries that match the pattern that is now starting and ending
"/^he/":
You can match a string that begins with the "he" character, such as Hello, height, and so on;
"/he$/":
You can match the string that ends with the "he" character, she, and so on;
"/he/":
The space begins with the function of ^, matching the string that begins with the He;
"/he/":
The space ends, and the function of $, matches the string ending with the He;
"/^he$/":
Indicates that only the string "he" matches.
The simple introduction of the PHP regular expression positioning character tells you here that it is helpful to understand and master the PHP regular expression positioning characters.
http://www.bkjia.com/PHPjc/446589.html www.bkjia.com true http://www.bkjia.com/PHPjc/446589.html techarticle The use of the PHP regular expression Positioning characters is often encountered during the development process, then the specific type of PHP regular expression positioning characters have what? What they specifically represent ...