1 package Catalyst::DispatchType::Regex;
4 use base qw/Catalyst::DispatchType::Path/;
7 my ($self, $c, $path) = @_;
9 return if $self->SUPER::prepare_action($c, $path);
11 foreach my $compiled (@{$self->{compiled}||[]}) {
12 if ( my @snippets = ( $path =~ $compiled->{re} ) ) {
13 $c->req->action($compiled->{path});
14 $c->req->match($path);
15 $c->req->snippets(\@snippets);
16 $c->action($compiled->{action});
17 $c->namespace($compiled->{action}->prefix);
26 my ( $self, $c, $action ) = @_;
27 my $attrs = $action->attributes;
28 my @register = map { @{$_ || []} } @{$attrs}{'Regex', 'Regexp'};
29 foreach my $r (@register) {
30 $self->{paths}{$r} = $action;
31 push(@{$self->{compiled}},