3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "this is sachinĂ¹s school of sachin"; $pattern = "sach"; if(preg_match("/[^ [:punct:]]*".$pattern."([^ [:punct:]]*)/u", $a, $match)){ print(mb_strlen($match[1], "UTF-8")); if($pattern == $match[0]){ print(" (full word)"); } } ?>

preferences:
34.8 ms | 402 KiB | 5 Q