<div dir="ltr"><div>Just a reminder, for people that have been hit by initially missing a detail, like me, and at least someone else in this -probably not a bug- report: <a href="https://rt.cpan.org/Public/Bug/Display.html?id=104451">https://rt.cpan.org/Public/Bug/Display.html?id=104451</a></div><div><br></div><div>If you&#39;re using the controller skeleton provided by &#39;<a href="http://myapp_create.pl">myapp_create.pl</a> controller ...&#39;, and want to import Types for Constraints like mentioned by John, be sure to either remove namespace::autoclean from your used modules, or use it properly so it doesn&#39;t clean your imported Types :) </div><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5"><br>
-----Original Message-----<br>
From: John Napiorkowski [mailto:<a href="mailto:jjn1056@yahoo.com">jjn1056@yahoo.com</a>]<br>
Sent: 07 July 2015 19:51<br>
To: The elegant MVC web framework<br>
Subject: Re: [Catalyst] Regex dispatch type is deprecated<br>
<br>
Dmitry,<br>
<br>
You can use the Regexp Dispatcher on CPAN, for legacy code.  There is no plan to stop supporting it, unless we hit a point where we can&#39;t support it when making required fixes to Catalyst.  I just wanted to remove it from Catalyst core such as to emphasis its no longer the approved approach and prevent people from writing new code with it.<br>
<br>
If you are using the newest Catalyst, we added Type Constraint matching to Args and this should let you dispatch on regexp types in a very similar manner.  Take a look at<br>
<br>
<br>
<a href="https://metacpan.org/pod/distribution/Catalyst-Runtime/lib/Catalyst/RouteMatching.pod#Using-type-constraints-in-a-controller" rel="noreferrer" target="_blank">https://metacpan.org/pod/distribution/Catalyst-Runtime/lib/Catalyst/RouteMatching.pod#Using-type-constraints-in-a-controller</a><br>
which has an example of using a regular expression type constraint generator is a way that functions similarly to how the old regexp worked.  For example:<br>
<br>
<br>
package MyApp::Controller::User;<br>
<br>
use Moose;<br>
use MooseX::MethodAttributes;<br>
use Types::Standard qw/StrMatch/;<br>
<br>
extends &#39;Catalyst::Controller&#39;;<br>
<br>
sub looks_like_a_date :Path(&#39;&#39;) Args(StrMatch[qr{\d\d-\d\d-\d\d\d\d}]) {<br>
  my ($self, $c, $date) = @_;<br>
}<br>
<br>
__PACKAGE__-&gt;meta-&gt;make_immutable;<br>
<br>
<br>
requires a URL like /user/11-11-2222<br>
That is one approach, or you can create custom ActionRoles for special dispatch rule needs.  In general I think the new feature to add type constraint checks on Args and CaptureArgs gives you everything you had with regexp and more.  Feedback, and bug fix patches welcomed!<br></div></div></blockquote></div></div></div>