PHP, as befits a modern programming language, offers the developer a set of functions for using regular expressions. You can search for occurrences of lines in other lines by complex criteria.
HTML, CSS, XML and other formalized files are classic tasks for applying the preg match all function. No less effective is the search for addresses, surnames, phone numbers, e-mail and other information in informal texts.
Function Format
PHP : preg match preg match all. , - . " ". - " ", - " ". "" , - "" . , . .
- , . - matches. preg match all :
- PREG_PATTERN_ORDER;
- PREG_SET_ORDER.
( ). .
-
, . , "". "", : .
- , , . , . , .
- - - .
- a-z - , , a z - .
- 0-9 - , , 1-3 - 1, 2 3.
. . , .
PHP preg match all . , :
- [abc] a, b, c.
- [^ABC] , A, B, C.
- \w \W - .
- \s \S - .
- \d \D - .
- {n,m} .
, , , , .
, , , , "^" , "$" - , . , preg match all. PHP , .
:
, ("+", "-"), / :
:
- /^[\s|\+|\-]{0,1}[0-9]*(\.)[0-9]*/ - .
- /[0-9a-z_-]+@[0-9a-z_^\.]+\.[a-z]{2,3}/ - e-mail.
preg match all, , .
. , . , . PHP preg match all, , , .