diff --git a/regulations/tests/urls_test.py b/regulations/tests/urls_test.py index a5c78c1b..88bba567 100644 --- a/regulations/tests/urls_test.py +++ b/regulations/tests/urls_test.py @@ -33,3 +33,9 @@ def test_diff_url(self): args=('201-2', '2011-1738_20121011', '2012-22345_20131022')) self.assertEqual( r, '/diff/201-2/2011-1738_20121011/2012-22345_20131022') + + def test_diff_url_supports_multiple_dashes(self): + r = reverse( + 'chrome_section_diff_view', + args=('201-Interp-XYZ', '2011-1738', '2012-22345')) + self.assertEqual(r, '/diff/201-Interp-XYZ/2011-1738/2012-22345') diff --git a/regulations/urls.py b/regulations/urls.py index 479190d7..01ec81cb 100644 --- a/regulations/urls.py +++ b/regulations/urls.py @@ -28,7 +28,7 @@ notice_pattern = meta_version % 'notice_id' reg_pattern = r'(?P[\d]+)' -section_pattern = r'(?P[\d]+[-][\w]+)' +section_pattern = r'(?P[\d]+[-][\w-]+)' interp_pattern = r'(?P[-\d\w]+[-]Interp)' paragraph_pattern = r'(?P[-\d\w]+)' subterp_pattern = r'(?P[\d]+-(Appendices|Subpart(-[A-Z]+)?)-Interp)'