Skip to content

Commit

Permalink
optional capture groups for alternative caplitalizations
Browse files Browse the repository at this point in the history
Signed-off-by: William Wedler <william.wedler@resquared.com>
  • Loading branch information
William Wedler committed Mar 24, 2022
1 parent 1fb3783 commit 80d3741
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ament_copyright/ament_copyright/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def search_copyright_information(content):
year_range = '%s-%s' % (year, year)
year_or_year_range = '(?:%s|%s)' % (year, year_range)
pattern = r'^[^\n\r]?\s*(?:\\copyright\s*)?' \
r'Copyright(?:\s+\(c\))?\s+(%s(?:,\s*%s)*),?\s+([^\n\r]+)$' % \
r'(?:Copyright|COPYRIGHT|copyright)' \
r'(?:\s+\((?:c|C)\))?\s+(%s(?:,\s*%s)*),?\s+([^\n\r]+)$' % \
(year_or_year_range, year_or_year_range)
regex = re.compile(pattern, re.DOTALL | re.MULTILINE)

Expand Down

0 comments on commit 80d3741

Please sign in to comment.