Sets a requirement for the given key.
@api
string $key The key:
string $regex The regex:
Route The current Route instance
public function setRequirement($key, $regex) {
$this->requirements[$key] = $this
->sanitizeRequirement($key, $regex);
$this->compiled = null;
return $this;
}