Pattern Modifiers

The following list contains all possible modifiers supported by the PCRE functions in PHP. Some Perl-specific modifiers are not supported, and conversely, there are some modifiers that Perl doesn’t have.

Modifier Description
i When this modifier is used, the matching of alphabetic characters in the pattern becomes non-case-sensitive; for example, /sgi/i matches both sgi and SGI. This is equivalent to Perl’s /i modifier.
m By default, PCRE treats the subject string as consisting of a single “line” of characters (even if it actually contains several newlines). The“start of line” metacharacter (^) matches only at the start of the string, while the “end of line” metacharacter ($) matches only at the end of the string, or before ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.