segment pattern to match a single segment, also matches UTF-8 segments.

This commit is contained in:
Mohammad Sadeghi 2012-09-24 16:15:11 +03:30
parent 9fae4dc8d7
commit 9df9a5df04
1 changed files with 2 additions and 0 deletions

View File

@ -76,6 +76,7 @@ class Router {
public static $patterns = array(
'(:num)' => '([0-9]+)',
'(:any)' => '([a-zA-Z0-9\.\-_%=]+)',
'(:segment)' => '([^/]+)',
'(:all)' => '(.*)',
);
@ -87,6 +88,7 @@ class Router {
public static $optional = array(
'/(:num?)' => '(?:/([0-9]+)',
'/(:any?)' => '(?:/([a-zA-Z0-9\.\-_%=]+)',
'/(:segment?)' => '(?:/([^/]+)',
'/(:all?)' => '(?:/(.*)',
);