<?php
namespace App\Utils\BaseParser\TextParser\Types;

/**
 * Set. It will match one of the values in 'val'. It behaves somewhat common to the Constant type
 * @author Lucian Sirbu
 */
class InSet extends \App\Utils\BaseParser\TextParser\BlockRegexpAbstract
{
	protected $extractRegexp = "/^(?P<rawData>__VALUE____LENGHTS__)/";

	public function  __construct($options = [], $parent = null)
	{
		$options['val_regex'] = sprintf("[%s]", implode("", array_map(function($v){
			return preg_quote($v, "/");
		}, $options['val'])));

		$options['val'] = null;

		parent::__construct($options, $parent);
	}
}
