Regular Expressions

Here we describe how yo can use regular expressions in revIgniter URI Routing.

If you prefer you can use regular expressions to define your routing rules. Any valid regular expression is allowed, as are back-references up to 10 ($1 - $10).

Note: If you use back-references you must use the dollar syntax.

A typical RegEx route might look something like this:

put "$1/id_$2" into gRoute[2]["products/([a-z]+)/(\d+)"]

In the above example, a URI similar to products/shirts/123 would instead call the shirts controller and the id_123 handler.

You can also mix and match wildcards with regular expressions.