PHP-generated regular, to
#Beginning
#uThe end, why the inside
/Backslashes are not escaped into
\/
php
(area|cat))-(?P
\d+)-(?P
\d+)-(?P
\d+)/(?P
\d+)/$#u';$str = 'info/area-19-0-0/40/';preg_match($pattern,$str,$matches);print_r($matches);
Array( [0] => info/area-19-0-0/40/ [type] => area [1] => area [2] => area [v1] => 19 [3] => 19 [v2] => 0 [4] => 0 [v3] => 0 [5] => 0 [page] => 40 [6] => 40)
Reply content:
PHP generated regular, at the # beginning #u of the end, why the inside of the backslash does / not have to escape into\/
php
(area|cat))-(?P
\d+)-(?P
\d+)-(?P
\d+)/(?P
\d+)/$#u';$str = 'info/area-19-0-0/40/';preg_match($pattern,$str,$matches);print_r($matches);
Array( [0] => info/area-19-0-0/40/ [type] => area [1] => area [2] => area [v1] => 19 [3] => 19 [v2] => 0 [4] => 0 [v3] => 0 [5] => 0 [page] => 40 [6] => 40)
Because its regular delimiter is a # number, it / does not need to be escaped.