setRegex($regex); } /** * @inheritDoc */ public function parseValue ($arg) { if(!preg_match($this->_regex, $arg, $matches)) throw new RangeException('La valeur ne correspond pas au motif attendu : ' . $arg); return $matches; } /** * @inheritDoc */ public function getValueDescription () { return $this->getRegex(); } /** * Le motif à respecter * * @return string Le motif * * @see $_regex */ public function getRegex() { return $this->_regex; } /** * Modifie le motif à respecter * * @param string $regex Le nouveau motif * * @return $this */ public function setRegex($regex = null) { $this->_regex = $regex; return $this; } }