3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "+!This is a text with some % special chars/text and ( for a string query to match. Then !! mor&&&e and so on...chars/text."; $stringToFind = "hars/t"; preg_match('~.{10}' . preg_quote($stringToFind) . '.{10}~', $text, $match); print_r($match);

preferences:
30.92 ms | 406 KiB | 5 Q