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

/**
 * Only digits
 * @author Lucian Sirbu
 *
 */
class Digits extends \App\Utils\BaseParser\TextParser\BlockRegexpAbstract
{
	public function __construct($options, $parent = null)
	{
		if ($options['allowSpaces']) {
			$this->extractRegexp = "/^(?P<rawData>([0-9]__LENGHTS__)|([\s]__LENGHTS__))/";
		}
		else {
			$this->extractRegexp = "/^(?P<rawData>[0-9]__LENGHTS__)/";
		}

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