- preg_match: documentation ( source)
- preg_replace: documentation ( source)
<?php
$test = "case ( 'this_is__test_innit'):";
if (!preg_match('/case[\s]*?\([\s]*?[\'|\"][^\'|^\"]+/', $test, $matches)) {
print 'no match';
} else {
print preg_replace('/case[\s]*?\([\s]*?[\'|\"]/', '', $matches[0]);
}