Skip to content

Commit

Permalink
fix(usc): Improve regex for section
Browse files Browse the repository at this point in the history
  • Loading branch information
flooie committed Apr 4, 2024
1 parent 1324555 commit 43a1778
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions reporters_db/data/laws.json
Original file line number Diff line number Diff line change
Expand Up @@ -5542,8 +5542,7 @@
"jurisdiction": "United States",
"name": "United States Code; United States Code Annotated; United States Code Service; Gould’s United States Code Unannotated",
"regexes": [
"(?P<title>\\d+),?\\s+$reporter,?\\s+$section_marker\\s*$law_section",
"(?P<title>\\d+),?\\s+$reporter,?\\s+$section_marker\\s*$law_sections"
"(?P<title>\\d+),?\\s+$reporter,?\\s+$section_marker\\s*$law_section"
],
"start": null,
"variations": [
Expand Down
6 changes: 2 additions & 4 deletions reporters_db/data/regexes.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
"#": "Regexes used in laws.json",
"day": "(?P<day>\\d{1,2}),?",
"month": "(?P<month>[A-Z][a-z]+\\.?)",
"section": "(?P<section>\\d+(?:[\\-.:]\\d+){,3})",
"section#": "Section like 1-2-3, 1.2.3, or 1:2-3.4",
"sections": "(?P<sections>\\d+(?:\\((?:[a-zA-Z]{1}|\\d{1,2})\\))+)",
"sections#": "Sections 81(a)(l)(C) or 81(a) - to capture section and subsections in parentheses",
"section": "(?P<section>(?:\\d+(?:[\\-.:]\\d+){,3})|(?:\\d+(?:\\((?:[a-zA-Z]{1}|\\d{1,2})\\))+))",
"section#": "Section like 1-2-3, 1.2.3, or 1:2-3.4 or 81(a)(2)(F) or 81(a)",
"subject": "(?P<subject>$law_subject_word(?: $law_subject_word| &){,4})",
"subject#": "One to five word statute subject like 'Parks Rec. & Hist. Preserv.', 'Not-for-Profit Corp.', 'Alt. County Gov’t', 'R.R.'",
"subject_word": "[A-Z][.\\-'A-Za-z]*",
Expand Down

0 comments on commit 43a1778

Please sign in to comment.