src/Primitive/String/String.php
public function replaceRegex($pattern, $replace)
    {
        return new static(StaticStringy::regexReplace(
            $this->string, $this->retrieveValue($pattern), $this->retrieveValue($replace))
        );
    }
public function replaceRegex($pattern, $replace)
    {
        return new static(StaticStringy::regexReplace(
            $this->string, $this->retrieveValue($pattern), $this->retrieveValue($replace))
        );
    }
Replaces all occurrences of $pattern by $replacement. An alias
for mb_ereg_replace().

@param string|StringInterface $pattern
@param string|StringInterface $replace
@return static