Converts a regex to make it suitable for mod_rewrite
string $regex The regex:
string The converted regex
private function regexToApacheRegex($regex) {
$regexPatternEnd = strrpos($regex, $regex[0]);
return preg_replace('/\\?P<.+?>/', '', substr($regex, 1, $regexPatternEnd - 1));
}