I'm filtering a few categories (cat1, cat2, cat3) to be rendered by different views then all the rest by other view functions. It is getting unwieldy to keep adding category slugs to the urlpatterns each time one is added. Can I factor that part out of the regex some how?
urlpatterns = patterns('catalog.category_views',
(r'^(?P<cat_slug>(cat1|cat2|cat3))/$', 'universal_category'),
(r'^(?P<cat_slug>(cat1|cat2|cat3))/(?P<subcat_slug>[-\w]+)/$', 'subcat_listing'),
(r'^(?P<cat_slug>(cat1|cat2|cat3))/part/(?P<part>[-\w]+)/$', 'subcat_product'),
)
urlpatterns += patterns('catalog.make_views',
(r'^(?P<cat_slug>[-\w]+)/$', 'category'),
(r'^(?P<cat_slug>[-\w]+)/(?P<make_slug>[-\w]+)/$', 'make'),
(r'^(?P<cat_slug>[-\w]+)/(?P<make_slug>[-\w]+)/(?P<model_slug>[-\w]+)/(?P<year_low>\d{4})-(?P<year_high>\d{4})/$', 'listing'),
(r'^(?P<cat_slug>[-\w]+)/part/(?P<part>[-\w]+)/$', 'product'),
)