private static function isPcre($pattern) { return (bool) preg_match('/^([~#]).+(\\1)[imsxUu]*\\z/s', $pattern); }