On Fri, Mar 02, 2007 at 12:08:42AM +0100, Boris ?erani? wrote: > > Regex('^training/webcasts/webcast_data/(\d+)/?(index.html)?$') > > > > matches: > > ../186/index.html : yes > > ../186/foo.html : yes > > ../186/ : yes > > ../186 : yes > > > > > (snip) > > Actually, this one works for me quite well - it should work fine for > following scenarios: > > .../186 > .../186/ > .../186/index.html > > In any other case, it will fail, as you can see:
Yes, when tested in Perl it works that way, but in Catalyst in other cases it still matches. That's the problem. Seems that Catalyst first tries to match the full path, then tries to match a reduced path. Adding a bit of debugging to Regex.pm's match() method: Request = /training/webcasts/webcast_data/162/foo.html Checking [training/webcasts/webcast_data/162/foo.html] Checking [training/webcasts/webcast_data/162] *MATCHED* So that's why it's matchine when I don't want it to match. -- Bill Moseley [EMAIL PROTECTED] _______________________________________________ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/