The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

Regular Expression too complex

Martin's Avatar

Martin

19 Jul, 2012 06:02 PM

I was reading the code, trying to understand how the :parameters are mapped and I've found an overcomplex regexp is been used.. Slim_Route::convertPatternToRegex

could you just use
return '(?P<' . $key . '>[^/]+)'; instead of
return '(?P<' . $key . '>[a-zA-Z0-9_\-\.\!\~\*\\\'\(\)\:\@\&\=\$\+,%]+)';

Maybe I am missing something, What's the rational behind that expr?

  1. Support Staff 1 Posted by Josh Lockhart on 19 Jul, 2012 06:03 PM

    Josh Lockhart's Avatar

    There's already a pull request that will simplify this. Will be available in 1.6.5 soon.

  2. Josh Lockhart closed this discussion on 19 Jul, 2012 06:03 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac