Skip to content

Commit

Permalink
avoid regressions in regex matching
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh Sinha (SW-GPU) committed May 8, 2024
1 parent 011ff4c commit 9b779e6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/reuse/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,13 @@

_COPYRIGHT_PATTERNS = [
re.compile(
r"(?P<copyright>(?P<prefix>SPDX-(File|Snippet)CopyrightText:"
r"(\s(\(C\)|Copyright\s(©|\(C\))?|©)?)?)\s+"
r"(?P<copyright>(?P<prefix>SPDX-(File|Snippet)CopyrightText:\s+"
r"(?:(?:\([cC]\)|©|(?:Copyright(?:\s\([cC]\)|\s©)?)?)?)?)\s+"
r"((?P<year>\d{4} ?- ?\d{4}|\d{4}),?\s+)?"
r"(?P<statement>.*?))" + _END_PATTERN
),
re.compile(
r"(?P<copyright>(?P<prefix>SPDX-(File|Snippet)CopyrightText:)\s+"
r"((?P<year>\d{4} ?- ?\d{4}|\d{4}),?\s+)?"
r"(?P<statement>.*?))" + _END_PATTERN
),
Expand Down

0 comments on commit 9b779e6

Please sign in to comment.