`routes.php` config example
The simplest way to transform dynamic routes into advanced routes, is to go to your craft_routes table and copy it out of urlPattern:

Example:

If you have set this in your backend:
news-sort/month/&lt;year&gt;/&lt;month&gt;

You'll find this in urlPattern:
news\-sort\/month\/(?P&lt;year&gt;\d{4})\/(?P&lt;month&gt;(?:0?[1-9]|1[012]))

Just remove the escaping \, and you've got your regex:
news-sort/month/(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;(?:0?[1-9]|1[012]))