Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




Regular Expression Functions (Perl-Compatible)

LIV. Regular Expression Functions (Perl-Compatible)

The syntax for patterns used in these functions closely resembles Perl. The expression should be enclosed in the delimiters, a forward slash (/), for example. Any character can be used for delimiter as long as it's not alphanumeric or backslash (\). If the delimiter character has to be used in the expression itself, it needs to be escaped by backslash.

The ending delimiter may be followed by various modifiers that affect the matching. See Pattern Modifiers.

Example 1. Examples of valid patterns

  • /<\/\w+>/

  • |(\d{3})-\d+|Sm

  • /^(?i)php[34]/

Example 2. Examples of invalid patterns

  • /href='(.*)' - missing ending delimiter

  • /\w+\s*\w+/J - unknown modifier 'J'

  • 1-\d3-\d3-\d4| - missing starting delimiter

Note: The Perl-compatible regular expression functions are available in PHP 4 and in PHP 3.0.9 and up.

Table of Contents
preg_match — Perform a regular expression match
preg_match_all — Perform a global regular expression match
preg_replace — Perform a regular expression search and replace
preg_split — Split string by a regular expression
preg_quote — Quote regular expression characters
preg_grep — Return array entries that match the pattern
Pattern Modifiers — Describes possible modifiers in regex patterns
Pattern Syntax — Describes PCRE regex syntax


With any suggestions or questions please feel free to contact us