3v4l.org

run code in 300+ PHP versions simultaneously
<?php $parts = ['hello', 'hi', 'how r u', 'how are you', 'how r you', 'how are u']; $strings = ['Hello', 'Helloooo', 'How r youuuu', 'hell', 'w are y', 'heey hello', 'heeeey hello bro']; $regexp = implode('|', $parts); foreach ($strings as $string) { echo "$string: " . (preg_match("/($regexp)/i", $string) ? "true\n" : "false\n"); }

preferences:
45.96 ms | 402 KiB | 5 Q