public static function fromList(array $words, array $options = [])
	{
		$options += [
			'delimiter'       => '/',
			'caseInsensitive' => false,
			'specialChars'    => [],
			'unicode'         => true
		];

		// Normalize ASCII if the regexp is meant to be case-insensitive
		if ($options['caseInsensitive'])
		{
			foreach ($words as &$word)
			{
				$word = strtr($word, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
			}
			unset($word);
		}

		$builder = new Builder([
			'delimiter' => $options['delimiter'],
			'meta'      => $options['specialChars'],
			'input'     => $options['unicode'] ? 'Utf8' : 'Bytes',
			'output'    => $options['unicode'] ? 'Utf8' : 'Bytes'
		]);

		return $builder->build($words);
	}
public static function fromList(array $words, array $options = [])
	{
		$options += [
			'delimiter'       => '/',
			'caseInsensitive' => false,
			'specialChars'    => [],
			'unicode'         => true
		];

		// Normalize ASCII if the regexp is meant to be case-insensitive
		if ($options['caseInsensitive'])
		{
			foreach ($words as &$word)
			{
				$word = strtr($word, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
			}
			unset($word);
		}

		$builder = new Builder([
			'delimiter' => $options['delimiter'],
			'meta'      => $options['specialChars'],
			'input'     => $options['unicode'] ? 'Utf8' : 'Bytes',
			'output'    => $options['unicode'] ? 'Utf8' : 'Bytes'
		]);

		return $builder->build($words);
	}
public static function fromList ( array $ words , array $ options = [ ] ) { $ options += [ 'delimiter' => '/' , 'caseInsensitive' => false , 'specialChars' => [ ] , 'unicode' => true ] ; // Normalize ASCII if the regexp is meant to be case-insensitive if ( $ options [ 'caseInsensitive' ] ) { foreach ( $ words as & $ word ) { $ word = strtr ( $ word , 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' , 'abcdefghijklmnopqrstuvwxyz' ) ; } unset ( $ word ) ; } $ builder = new Builder ( [ 'delimiter' => $ options [ 'delimiter' ] , 'meta' => $ options [ 'specialChars' ] , 'input' => $ options [ 'unicode' ] ? 'Utf8' : 'Bytes' , 'output' => $ options [ 'unicode' ] ? 'Utf8' : 'Bytes' ] ) ; return $ builder -> build ( $ words ) ; }
Create a regexp pattern that matches a list of words

@param  array  $words   Words to sort (must be UTF-8)
@param  array  $options
@return string
Create a regexp pattern that matches a list of words