The comparison between POSIX and Perl-compatible regular expressions (preg_match, preg_replace, ereg, and ereg_replace). For more information, see. First, let's take a look at the two main functions of POSIX-style regular expressions:
Ereg function:
First look at the two main functions of the POSIX-style regular expression:
Ereg function: (Regular expression match)
Format: int ereg (string pattern, string string [, array ®s])
Note: the Preg_match () function that uses Perl-compatible
First, let's take a look at the two main functions of POSIX-style Regular Expressions:
Ereg function: (Regular Expression matching)
Format: int ereg (string pattern, string [, array & regs])Note: The preg_match () function using Perl
After PHP is upgraded to 5.3,ProgramThe error "function split () is deprecated" is returned.This is because of various reasons (mainly for the reason of regular expressions, see below for details). The split function is not supported in the new
PHP string regular expression replacement function preg_replace. Syntax: mixedpreg_replace (mixedpattern, mixedreplacement, mixedsubject); return value: mixed type data function type: data processing content description: This function uses pattern
This article will introduce common string Regular Expression replacement and segmentation function comparison in PHP. The following are some examples of php string Regular Expression replacement: the str_replace, str_ireplace, substr_replace,
Syntax: mixed preg_replace (mixed pattern, mixed replacement, mixed subject );Returned value: Hybrid DataFunction type: data processingDescription: This function uses the pattern rule to parse and compare the string subject. The string to be
The comparison between POSIX and Perl-compatible regular expressions (preg_match, preg_replace ,. First, let's take a look at the POSIX regular expression's two main functions: ereg function :( regular expression matching) format: intereg
Let's take a look at the two main functions of the POSIX-style regular expression:
Ereg function: (Regular expression matching)
Format: int ereg (string pattern, string string [, array ®s])
Note: the Preg_match () function that uses
: This article mainly introduces the PHP regular expression syntax summary. if you are interested in the PHP Tutorial, you can refer to it. Http://bbs.chinaunix.net/forum.php? Mod = viewthread & tid = 4101636.
Use well
Regular expressionPHP is often
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.