izzum\statemachine\State::isNegatedRegex PHP Method

isNegatedRegex() public method

is this state a negated regex type of state? "not-regex:"
public isNegatedRegex ( ) : boolean
return boolean
    public function isNegatedRegex()
    {
        return strpos($this, self::REGEX_PREFIX_NEGATED) === 0;
    }

Usage Example

 /**
  * does an input regex state match a target states' name?
  *
  * @param State $regex
  *            the regex state
  * @param State $target
  *            the state to match the regular expression to
  * @return boolean
  * @link https://php.net/manual/en/function.preg-match.php
  * @link http://regexr.com/ for trying out regular expressions
  */
 public static function matchesRegex(State $regex, State $target)
 {
     $matches = false;
     if ($regex->isNormalRegex()) {
         $expression = str_replace(State::REGEX_PREFIX, '', $regex->getName());
         $matches = preg_match($expression, $target->getName()) === 1;
     }
     if ($regex->isNegatedRegex()) {
         $expression = str_replace(State::REGEX_PREFIX_NEGATED, '', $regex->getName());
         $matches = preg_match($expression, $target->getName()) !== 1;
     }
     return $matches;
 }
All Usage Examples Of izzum\statemachine\State::isNegatedRegex