CodeIgniter Forums
Slashes in routes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Slashes in routes (/showthread.php?tid=11412)



Slashes in routes - El Forum - 09-07-2008

[eluser]DPrevite[/eluser]
Is it possible to do slashes inside a regex match? I want to match
Code:
/controller/display/path/to/something

And then have that go into my display function with the string "path/to/something"

I tried this in my routes file, but didn't have any luck.
Code:
$route['controller/([A-Z0-9/])'] = 'controller/display/$1';



Slashes in routes - El Forum - 09-07-2008

[eluser]Crafter[/eluser]
To do slashes inside regex, prepend the slash like this
Code:
\/controller\/display\/path\/to\/something