Phlexy\LexerDataGenerator::getCompiledRegexForPregReplace PHP Method

getCompiledRegexForPregReplace() public method

public getCompiledRegexForPregReplace ( array $regexes, $additionalModifiers = '' )
$regexes array
    public function getCompiledRegexForPregReplace(array $regexes, $additionalModifiers = '')
    {
        // the \G is not strictly necessary, but it makes preg_replace abort early when not lexable
        return '~\\G((' . str_replace('~', '\\~', implode(')|(', $regexes)) . '))~' . $additionalModifiers;
    }