src/VerbalExpressions.php
public function limit($min, $max = 0) {
        if ($max == 0) {
            $value = "{" . $min . "}";
        } elseif ($max < $min) {
            $value = "{" . $min . ",}";
        } else {
            $value = "{" . $min . "," . $max . "}";
        }
        // check if the expression has * or + for the last expression
        if (preg_match("/\*|\+/", $this->lastAdded)) {
            $l = 1;
            $this->source = strrev(str_replace(array('+', '*'), strrev($value), strrev($this->source), $l));
            return $this;
        }
        return $this->add($value);
    }
public function limit($min, $max = 0) {
        if ($max == 0) {
            $value = "{" . $min . "}";
        } elseif ($max < $min) {
            $value = "{" . $min . ",}";
        } else {
            $value = "{" . $min . "," . $max . "}";
        }
        // check if the expression has * or + for the last expression
        if (preg_match("/\*|\+/", $this->lastAdded)) {
            $l = 1;
            $this->source = strrev(str_replace(array('+', '*'), strrev($value), strrev($this->source), $l));
            return $this;
        }
        return $this->add($value);
    }
public function limit ( $ min , $ max = 0 ) { if ( $ max == 0 ) { $ value = "{" . $ min . "}" ; } elseif ( $ max < $ min ) { $ value = "{" . $ min . ",}" ; } else { $ value = "{" . $ min . "," . $ max . "}" ; } // check if the expression has * or + for the last expression if ( preg_match ( "/\*|\+/" , $ this -> lastAdded ) ) { $ l = 1 ; $ this -> source = strrev ( str_replace ( array ( '+' , '*' ) , strrev ( $ value ) , strrev ( $ this -> source ) , $ l ) ) ; return $ this ; } return $ this -> add ( $ value ) ; }
Limit

Adds char limit to the last added expression.
If $max is less then $min the limit will be: At least $min chars {$min,}
If $max is 0 the limit will be: exactly $min chars {$min}
If $max bigger then $min the limit will be: at least $min but not more then $max {$min, $max}

@access public
@param integer $min
@param integer $max
@return VerbalExpressions
Limit