Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand PHP regular expression function Library

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

How to understand the PHP regular expression library, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can get something.

What is the PHP regular expression function library? Here we introduce you to the PHP regular expression library (POSIX extension) greedy matching, and we should pay attention to those features that are not supported in the conditional subpattern and many other POSIX extension regular expression syntax.

Warnings in learning the PHP regular expression function library:

This type of regular expression is not safe for binary mode. The PCRE function library can. Regular expressions are used in PHP to do complex string manipulation. The functions that support regular expressions are:

◆ ereg ()

◆ ereg_replace ()

◆ eregi ()

◆ eregi_replace ()

◆ split ()

◆ spliti ()

These functions all accept a regular expression string as their * arguments. PHP uses the POSIX extension regular expression defined by POSIX 1003.3. For a complete description of POSIX regular expressions, see the man page included in the regex directory of the PHP distribution. You can read it through commands like man / usr/local/src/regex/regex.7.

Requirements: no external library files can be added to this extension module support.

Installation warning: do not change TYPE unless you know what you are doing.

To activate the support for regexp, add-- with-regex [= TYPE] when configuring PHP. TYPE can be one of system,apache or php. Php is used by default.

The Windows version of PHP has built-in support for this extension module. You do not need to load any additional extension libraries to use these functions. Let's take a look at the specific operations:

◆ runtime configuration: this extension module does not define any setup instructions.

◆ resource type: this extension module does not define any resource types.

◆ predefined constants: this extension module does not define any constants.

An example of a PHP regular expression function:

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report