Re: [Catalyst] Regex -- optional index.html

2007-03-02 Thread Bill Moseley
On Thu, Mar 01, 2007 at 04:13:05PM -0800, Bill Moseley wrote: 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

Re: [Catalyst] Regex -- optional index.html

2007-03-02 Thread Michael Reece
i don't think it's a bug. Catalyst::Manual::Intro also says: You can pass variable arguments as part of the URL path, separated with forward slashes (/). If the action is a Regex or LocalRegex, the '$' anchor must be used. For example, suppose you want to handle /foo/ $bar/$baz, where

Re: [Catalyst] Regex -- optional index.html

2007-03-02 Thread Brian Kirkbride
Michael Reece wrote: i don't think it's a bug. snip have you tried adding :Args(0) to the action? That was my guess too, I've been bit by this problem before adding Args(0) to my actions. - Brian ___ List: Catalyst@lists.rawmode.org

Re: [Catalyst] Regex -- optional index.html

2007-03-01 Thread Boris Ćeranić
On 01/03/07, Bill Moseley [EMAIL PROTECTED] wrote: I want to match these two (not using Chained, btw): /training/webcasts/webcast_data/186/ /training/webcasts/webcast_data/186/index.html But not this: /training/webcasts/webcast_data/186/foo.html (snip) I tried these:

Re: [Catalyst] Regex -- optional index.html

2007-03-01 Thread Jon
How about this: m!^training/webcasts/webcast_data/(\d+)/(index.html|$)! On Thu, 2007-03-01 at 14:51 -0800, Bill Moseley wrote: I want to match these two (not using Chained, btw): /training/webcasts/webcast_data/186/ /training/webcasts/webcast_data/186/index.html But not this:

Re: [Catalyst] Regex -- optional index.html

2007-03-01 Thread Bill Moseley
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