protected function doMatch($type = 'find')
{
$final_pattern = '(?:' . $this->pattern . ')';
switch ($type) {
case 'matches':
$final_pattern = '^' . $final_pattern . '$';
break;
case 'lookingAt':
$final_pattern = '^' . $final_pattern;
break;
case 'find':
default:
// no changes
break;
}
$final_pattern = '/' . $final_pattern . '/x';
return preg_match($final_pattern, $this->subject, $this->groups, PREG_OFFSET_CAPTURE) == 1 ? true : false;
}