Regular Expressions
Regular expressions are an amazingly powerful but tedious tool available in most of today’s programming languages. Think of regular expressions as an elaborate system of matching patterns. You first write the pattern, then use one of PHP’s built-in functions to apply the pattern to a text string (regular expressions are specifically for use with strings).
PHP has two functions for using regular expressions to match patterns (one casesensitive and one not) and two for matching patterns and replacing matched text with other text (again, one case-sensitive and one not). Further, PHP supports two types of regular expressions: POSIX Extended and Perl-compatible (PCRE). The POSIX version is somewhat less powerful and potentially ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access