protected function isRegexp($pattern) { return in_array($pattern[mb_strlen($pattern) - 1], array('^', '*', '$')); }