Welcome Guest, Not a member yet? Register   Sign In
Regex Help!
#1

[eluser]beaudierman[/eluser]
I'm trying to set up a custom 404 page using the 404_override option. Trouble is, I have a route set up as (:any) which apparently completely breaks 404_override. If I remove the (:any) rule, it works fine. So, I need to eliminate my (:any) call and instead be specific about what I want for that rule, the problem is that regex doesn't seem to work very well.

Basically I just need to match 3 digits, followed by a dash, then anything.

What I have:
Code:
$route['^\d{3}-(.*)$'] = 'product/index/$1';

I've also tried:
Code:
$route['(:num)-(:any)'] = 'product/index/$1';

Which works great on regexpal, but, not on CI. My regex is very rusty so if anyone has any suggestions I'd greatly appreciate it.


Messages In This Thread
Regex Help! - by El Forum - 06-26-2012, 01:04 PM
Regex Help! - by El Forum - 06-26-2012, 01:50 PM
Regex Help! - by El Forum - 06-26-2012, 01:52 PM
Regex Help! - by El Forum - 06-26-2012, 01:55 PM
Regex Help! - by El Forum - 06-26-2012, 02:06 PM
Regex Help! - by El Forum - 06-26-2012, 02:09 PM
Regex Help! - by El Forum - 06-26-2012, 02:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB