This method returns ~true~ on successfull match of ~$url~ and matched parts in ~$matches~ array.
- Example: ~RouteExpression::compile('[/ru]/story/')->match('/story/', $matches);~ returns ~true~ and ~$matches~ contains empty string which corresponds to optional part of expression.
+ Examples.
+
+ ~RouteExpression::compile('[/ru]/story/')->match('/story/', $matches)~ returns ~true~ and ~$matches~ contains empty string which corresponds to optional part of expression.
+
+ ~RouteExpression::compile('/article/:slug')->match('/article/php-is-awesome', $matches)~ returns ~true~ and ~$matches~ contains ~'php-is-awesome'~.
** Reversing
This method substitutes values from ~$matches~ array to the expression and returns url.
+ Example.
+
+ ~RouteExpression::compile('/article/:slug')->reverse(array('/article/php-is-awesome')~ returns ~'/article/php-is-awesome'~.
+