Skip to content

Commit

Permalink
Use a stricter regex for arXiv identifiers
Browse files Browse the repository at this point in the history
See https://arxiv.org/help/arxiv_identifier
Does not check the number of digits, but avoids a greedy match of ".pdf".

Fixes https://phabricator.wikimedia.org/T187791

Bug: T187791
  • Loading branch information
nemobis committed Apr 30, 2018
1 parent b0fbffa commit bf32cdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/oabot/arguments.py
Expand Up @@ -100,7 +100,7 @@ def present_and_free(self, template):
custom_access=True),
ArgumentMapping(
'arxiv',
r'https?://arxiv\.org/(abs|pdf)/(.*)(.pdf)?',
r'https?://arxiv\.org/(abs|pdf)/(\d+\.[\dv]+)(\.pdf)?',
group_id=2,
alternate_names=['eprint'],
always_free=True),
Expand Down

0 comments on commit bf32cdb

Please sign in to comment.