search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

PHP PCRE

Collection 1351
Read 450447
update time 2016-09-11

PHP Regular Expression (PCRE)

Regular expression (regular expression) describes a string matching pattern that can be used to check a Whether the string contains a certain substring, replacing the matching substring, or extracting a substring that meets a certain condition from a string, etc.

For more information on regular expressions, please refer to our: Regular Expressions - Tutorial.

In PHP we can use the PCRE extension to match string patterns.

PCRE function

##FunctionDescriptionpreg_filter preg_grep preg_last_error preg_match_all ##preg_match Perform a regular expression matchpreg_quote Escape regular expression characterspreg_replace_callback_array Performs a regular expression search and replaces with a callbackpreg_replace_callback Performs a regular expression search and replaces using a callback##preg_replace preg_split

PREG Constant

Perform a regular expression search and replace

Return matches Pattern array entry


Returns the error code generated by the last PCRE regular execution


Perform a global regular expression match







Perform a regular expression search and replace

Separate strings by a regular expression


##5.2.0PREG_BACKTRACK_LIMIT_ERROR PREG_RECURSION_LIMIT_ERROR If the recursion limit is exceeded, returned when preg_last_error() is called. PREG_BAD_UTF8_ERROR If the last error is due to abnormal utf-8 data ( Available only when running regular expressions in UTF-8 mode). Caused by calling preg_last_error() to return. PREG_BAD_UTF8_OFFSET_ERROR If the offset does not match a legal urf-8 code (Only available when running regular expressions in UTF-8 mode). Call preg_last_error() to return. PCRE_VERSION PCRE version number and release date (for example: "7.0 18- Dec-2006").
Constant Description From which version
PREG_PATTERN_ORDER

The results are sorted according to "rules" and are only used for preg_match_all(), that is, $matches[0] is the matching result of the complete rule, $ matches[1] is the result of the first subgroup match, and so on.

since
PREG_SET_ORDER

The results are sorted by "set", only used for preg_match_all(), that is, $matches[ 0] saves all results (including subgroups) information of the first matching result, $matches[1] saves the second result information, and so on.


PREG_OFFSET_CAPTURE

View the description of PREG_SPLIT_OFFSET_CAPTURE.

4.3.0
PREG_SPLIT_NO_EMPTY

This flag tells preg_split() to return the non-empty part.


PREG_SPLIT_DELIM_CAPTURE

This tag tells preg_split() to also capture bracket expressions matched to Content.

4.0.5
PREG_SPLIT_OFFSET_CAPTURE

If this tag is set, the matching substring will appear each time The offset of is also returned. Note that this will change the value in the returned array so that each element is an array consisting of the matched substring as the 0th element and its offset relative to the target string as the 1st element. This flag can only be used with preg_split().

4.3.0
PREG_NO_ERROR

Call preg_last_error() to return when there is no matching error.

5.2.0
PREG_INTERNAL_ERROR

If there is an internal PCRE error, call preg_last_error() to return.

If the callback limit is exceeded, returned when calling preg_last_error().


##5.2.0


5.2.0


5.2.0


5.3.0


5.2.4

Hot AI Tools
Undress AI Tool
Undress AI Tool

Undress images for free

AI Clothes Remover
AI Clothes Remover

Online AI tool for removing clothes from photos.

Undresser.AI Undress
Undresser.AI Undress

AI-powered app for creating realistic nude photos

ArtGPT
ArtGPT

AI image generator for creative art from text prompts.

Stock Market GPT
Stock Market GPT

AI powered investment research for smarter decisions

Popular tool
Notepad++7.3.1
Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version
SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1
Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6
Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version
SublimeText3 Mac version

God-level code editing software (SublimeText3)