3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php mb_internal_encoding('UTF-8'); $text = <<<TEXT Павел Дуров fsdf sdf sdf TEXT; $filter = 'Павел Дуров'; $filter = mb_strtolower($filter); $parts = mb_split('[\x00-\x20]+', $filter); $parts = array_map('trim', $parts); $parts = array_filter($parts); $parts = array_map('preg_quote', $parts); $filter = implode('.*', $parts); echo "~{$filter}~uis";
Output for 7.1.7
~павел.*дуров~uis