/** * @return RegexCharacterSetBuilder */ public function pattern() { switch ($this->case) { case 'lower': return RegexCharacterSetBuilder::newInstanceFromRange('a', 'z'); case 'upper': return RegexCharacterSetBuilder::newInstanceFromRange('A', 'Z'); } //all $instance = RegexCharacterSetBuilder::newInstanceFromRange('a', 'z'); $instance->addRange('A', 'Z'); return $instance; }
/** * @return RegexCharacterSetBuilder */ public function digitsSet() { return RegexCharacterSetBuilder::newInstanceFromRange('0', '9'); }