PHP Regular Expression Types

There are two sets of PHP functions that facilitate regular expressions. The preferred set is the PCRE (Perl-Compatible Regular Expressions) library. You can identify these functions because, in PHP, they start with the prefix preg. Examples of PCRE regular expression functions are preg_replace(), preg_split(), preg_match(), and preg_match_all(). The other regular expression family available within PHP is POSIX (Extended Regular Expressions). These functions begin with the prefix ereg and are included in PHP primarily for backward compatibility. The ereg instructions have been deprecated since PHP 5.3.0 and are mentioned here only because you’ll be exposed to them as you explore PHP regular expression instructions ...

Get Webbots, Spiders, and Screen Scrapers, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.