$re = '/the/';
$str = 'Text starts with (Regex Expression /)
This test is to help with the Regex when the symbol is / and looks for any text where the text is contained
Change the box above to have the word the and it will match all the thes in the text, this is case sensitive.
-------------
Text starts with (Regex Expression ^)
This test is to help with the Regex when the symbol is ^ and looks for text which starts with ^
Change the box above to have the word ^Text and it will match the first example.
-------------
Text ends with (Regex Expression $)
This test is to help with the Regex when the symbol is $ and looks for text which ends with xxxxx$
Change the box above to have the word example$ and make sure that you are looking at the multi-line add this in the text field at the top near the g (will not be relevant for URL) and it will match the last example
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php