python - Non-greedy matching in webapp2 routes? -


i have 2 routes in python app i'm working on, , can't seem make matching work correctly. routes like:

webapp2.route('/(.*?)/(.*?)', grouploader.loader), webapp2.route(r'/edit/(.*?)/(.*?)', handler='grouploader.editor'), 

i'd urls /a/b go first , /edit/a/b go second. apparently matches here greedy, since first rule matches, returning me "edit/a" , "b" 2 values. there way make work, or barking wrong tree?

invert routes, , don't use lazy matching, have better tool that:

webapp2.route('/edit/([^/]+)/([^/]+)', handler = 'grouploader.editor'); webapp2.route('/([^/]+)/([^/]+)', grouploader.loader); 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -