Skip to content

Commit

Permalink
fix(regexes): add optional space to antecedent regexes
Browse files Browse the repository at this point in the history
Solves #209
  • Loading branch information
grossir committed Feb 12, 2025
1 parent 32ee756 commit 86bf8ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eyecite/regexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def short_cite_re(regex):
# What case does a short cite refer to? For now, we just capture the previous
# word optionally followed by a comma. Example: Adarand, 515 U.S. at 241.
SHORT_CITE_ANTECEDENT_REGEX = r"""
(?P<antecedent>[A-Za-z][\w\-.]+),?
(?P<antecedent>[A-Za-z][\w\-.]+) ?,?
\ # final space
"""

Expand All @@ -224,9 +224,9 @@ def short_cite_re(regex):
# and the word before it (to store as antecedent).
SUPRA_ANTECEDENT_REGEX = r"""
(?:
(?P<antecedent>[\w\-.]+),?\ (?P<volume>\d+)|
(?P<antecedent>[\w\-.]+)\ ?,?\ (?P<volume>\d+)|
(?P<volume>\d+)|
(?P<antecedent>[\w\-.]+),?
(?P<antecedent>[\w\-.]+)\ ?,?
)
\ # final space
"""
Expand Down

0 comments on commit 86bf8ba

Please sign in to comment.