public function serializeStrings(array $strings)
	{
		$info         = $this->analyzeStrings($strings);
		$alternations = array_map([$this, 'serializeString'], $info['strings']);
		if (!empty($info['chars']))
		{
			// Prepend the character class to the list of alternations
			array_unshift($alternations, $this->serializeCharacterClass($info['chars']));
		}

		$expr = implode('|', $alternations);
		if ($this->needsParentheses($info))
		{
			$expr = '(?:' . $expr . ')';
		}

		return $expr . $info['quantifier'];
	}
public function serializeStrings(array $strings)
	{
		$info         = $this->analyzeStrings($strings);
		$alternations = array_map([$this, 'serializeString'], $info['strings']);
		if (!empty($info['chars']))
		{
			// Prepend the character class to the list of alternations
			array_unshift($alternations, $this->serializeCharacterClass($info['chars']));
		}

		$expr = implode('|', $alternations);
		if ($this->needsParentheses($info))
		{
			$expr = '(?:' . $expr . ')';
		}

		return $expr . $info['quantifier'];
	}
public function serializeStrings ( array $ strings ) { $ info = $ this -> analyzeStrings ( $ strings ) ; $ alternations = array_map ( [ $ this , 'serializeString' ] , $ info [ 'strings' ] ) ; if ( ! empty ( $ info [ 'chars' ] ) ) { // Prepend the character class to the list of alternations array_unshift ( $ alternations , $ this -> serializeCharacterClass ( $ info [ 'chars' ] ) ) ; } $ expr = implode ( '|' , $ alternations ) ; if ( $ this -> needsParentheses ( $ info ) ) { $ expr = '(?:' . $ expr . ')' ; } return $ expr . $ info [ 'quantifier' ] ; }
Serialize given strings into a regular expression

@param  array[] $strings
@return string
Serialize given strings into a regular expression