10 Regular Expressions
Regular expressions are the ultimate in dealing with strings. A regular expression is a pattern with which a string can be compared and edited.
The regular expressions in PHP originally come from the Perl programming language. In practice, they are mainly used for validations and searches within strings that cannot be covered by simpler checks such as equality. Accordingly, after the basics and an overview of the functions, you will also find some application examples such as the filtering of zip codes, telephone numbers, and links.
Note
In PHP, there has long been a second type of regular expression (RegEx): POSIX.[ 75 ] This type came from the regular expressions in the Unix command line. They were used with the ereg_* ...
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