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

$ perl -le 'print "YES" if "training/webcasts/webcast_data/186/index.html"  =~  
m!^training/webcasts/webcast_data/(\d+)/(index.html)?$!'
YES
$ perl -le 'print "YES" if "training/webcasts/webcast_data/186/"  =~  
m!^training/webcasts/webcast_data/(\d+)/(index.html)?$!'
YES
$ perl -le 'print "YES" if "training/webcasts/webcast_data/186/foo.html"  =~  
m!^training/webcasts/webcast_data/(\d+)/(index.html)?$!


I tried these:

    Regex('^training/webcasts/webcast_data/(\d+)/(index.html)?$')

        matches:
            ../186/index.html   : yes
            ../186/foo.html     : no
            ../186/             : no
            ../186              : no


    Regex('^training/webcasts/webcast_data/(\d+)/?(index.html)?$')

        matches:
            ../186/index.html   : yes
            ../186/foo.html     : yes
            ../186/             : yes
            ../186              : yes


    Regex('^training/webcasts/webcast_data/(\d+)(/?index.html)?$')

        matches:
            ../186/index.html   : yes
            ../186/foo.html     : yes
            ../186/             : yes
            ../186              : yes




-- 
Bill Moseley
[EMAIL PROTECTED]


_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to