I have this route:
$route["((parameter|type|something)-([0-9]+)\/)+"] = 'somecontroller';
so when i test the url with this:
www.somewebsite.com/parameter-1/
codeigniter returns with a page not found error. But I tested the regular expression here:
and it seems to work perfectly fine.
Edit: I have also tried putting the leading/trailing /’s:
$route["/((parameter|type|something)-([0-9]+)\/)+/"] = 'somecontroller';
Edit: Ok thanks to Omega(user), it’s because the slash character(/) has special precedence or effect in the codeigniter’s route parsing engine. So if it’s part of the regular expression you have express how many times it can appear, not sure why, so you can follow it by these operators {} or ? or * or +, or any other operator that deals with how many times the preceding expression appears. So the above route, with the ? operator works:
$route["/((parameter|type|something)-([0-9]+)\/)+/?"] = 'somecontroller';
It’s clearly a codeigniter specific issue.
Try add
?to the pattern >>((parameter|type|something)-([0-9]+)\/?)+