ParallelRegex::getCompoundedRegex PHP Method

getCompoundedRegex() protected method

Caches the regex. Will automatically escape (, ) and / tokens.
protected getCompoundedRegex ( )
    protected function getCompoundedRegex()
    {
        if ($this->regex === null) {
            for ($i = 0, $count = count($this->patterns); $i < $count; $i++) {
                $this->patterns[$i] = '(' . str_replace(array('/', '(', ')'), array('\\/', '\\(', '\\)'), $this->patterns[$i]) . ')';
            }
            $this->regex = '/' . implode('|', $this->patterns) . '/' . $this->getPerlMatchingFlags();
        }
        return $this->regex;
    }