Themosis\Route\Route::getRewriteRuleRegex PHP Method

getRewriteRuleRegex() public method

Returns the regex to be registered as a rewrite rule to let WordPress know the existence of this route
public getRewriteRuleRegex ( ) : mixed | string
return mixed | string
    public function getRewriteRuleRegex()
    {
        // Get the regex of the compiled route
        $routeRegex = $this->getCompiled()->getRegex();
        // Remove the first part (#^/) of the regex because WordPress adds this already by itself
        $routeRegex = preg_replace('/^\\#\\^\\//', '^', $routeRegex);
        // Remove the last part (#s$) of the regex because WordPress adds this already by itself
        $routeRegex = preg_replace('/\\#[s]$/', '', $routeRegex);
        return $routeRegex;
    }