Introduction
The syntax for patterns used in these functions closely resembles
Perl. The expression must be enclosed in the delimiters, a
forward slash (/), for example. Any character can be used for
delimiter as long as it's not alphanumeric or backslash (\). If
the delimiter character has to be used in the expression itself,
it needs to be escaped by backslash. Since PHP 4.0.4, you can also use
Perl-style (), {}, [], and <> matching delimiters.
See Pattern Syntax
for detailed explanation.
The ending delimiter may be followed by various modifiers that
affect the matching.
See Pattern
Modifiers.
PHP also supports regular expressions using a POSIX-extended syntax
using the POSIX-extended regex functions.
Note:
This extension maintains a global per-thread cache of compiled regular
expressions (up to 4096).