A brief analysis of PHP regular expression positioning characters_PHP tutorial

WBOY
Release: 2016-07-15 13:26:37
Original
830 people have browsed it

The use of PHP regular expression positioning characters is something we often encounter during the development process. So what are the specific types of PHP regular expression positioning characters? What do they specifically represent? Let’s start introducing them one by one.

The role of PHP regular expression positioning characters:

PHP regular expression positioning characters are a very important type of characters in PHP regular expressions, and their main functions are It is used to describe the position of characters in the matching object.

Types and meanings of PHP regular expression positioning characters:

◆^:

indicates that the matching pattern appears in The beginning of the matching object (different from "[]")

◆$:

means that the matching pattern appears at the end of the matching object

◆Space:

Indicates that the matched pattern appears at one of the two boundaries between the beginning and the end

◆"/^he/":

can match strings starting with the "he" character, such as hello, height, etc.;

◆"/he$/":

Can match strings ending with "he" characters, that is, she, etc.;

◆"/ he/":

Starting with a space, has the same effect as ^ , matches strings starting with he;

◆"/he /":

ends with a space, has the same effect as $, matches strings ending with he ;

◆"/^he$/":

means it only matches the string "he".

This is a brief introduction to PHP regular expression positioning characters. I hope it will be helpful for you to understand and master PHP regular expression positioning characters.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446589.htmlTechArticleThe use of PHP regular expression positioning characters is something we often encounter in the development process, so specific What are the types of positioning characters in PHP regular expressions? What do they specifically represent...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!