classes/Route.php
public function & rules(array $rules){
      foreach ((array)$rules as $varname => $rule){
        $this->rules[$varname] = $rule;
      }
      $this->pattern         = $this->compilePatternAsRegex( $this->URLPattern, $this->rules );
      $this->matcher_pattern = $this->compilePatternAsRegex( $this->URLPattern, $this->rules, false );
      return $this;
    }
public function & rules(array $rules){
      foreach ((array)$rules as $varname => $rule){
        $this->rules[$varname] = $rule;
      }
      $this->pattern         = $this->compilePatternAsRegex( $this->URLPattern, $this->rules );
      $this->matcher_pattern = $this->compilePatternAsRegex( $this->URLPattern, $this->rules, false );
      return $this;
    }
public function & rules ( array $ rules ) { foreach ( ( array ) $ rules as $ varname => $ rule ) { $ this -> rules [ $ varname ] = $ rule ; } $ this -> pattern = $ this -> compilePatternAsRegex ( $ this -> URLPattern , $ this -> rules ) ; $ this -> matcher_pattern = $ this -> compilePatternAsRegex ( $ this -> URLPattern , $ this -> rules , false ) ; return $ this ; }
Defines the regex rules for the named parameter in the current URL pattern

Example:
<code>
Route::on('/proxy/:number/:url')
->rules([
'number'  => '\d+',
'url'     => '.+',
]);
</code>

@param  array  $rules The regex rules
@return Route
Defines the regex rules for the named parameter in the current URL pattern