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:

(snip)

    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:

$ perl -e 'print "YES" if "webcast_data/186" =~
m|^webcast_data/(\d+)/?(index\.html)?$|;'
YES

$ perl -e 'print "YES" if "webcast_data/186/" =~
m|^webcast_data/(\d+)/?(index\.html)?$|;'
YES

$ perl -e 'print "YES" if "webcast_data/186/index.html" =~
m|^webcast_data/(\d+)/?(index\.html)?$|;'
YES

$ perl -e 'print "YES" if "webcast_data/186/asdf.html" =~
m|^webcast_data/(\d+)/?(index\.html)?$|;'


Regards,
Boris

_______________________________________________
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/

Reply via email to