Perl Compatible Regular Expressions (PCRE)¶
PCRE is the library that supports regular expressions in PHP. It offers functions to search and replace in strings, and arrays of strings.
<?php
preg_match('/PHP is (.*?)\./', 'PHP is fantastic.', $r);
print $r[1]; // fantastic
?>
See also https://www.pcre.org/