SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit ee3ef9cf authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Correct failing regexes: . matched any char

parent 02050331
No related branches found
No related tags found
No related merge requests found
......@@ -10,10 +10,10 @@ REGEX_CHOICES = '|'.join([j.doi_label for j in Journal.objects.all()])
# Regex used for URLs of specific Publications and for
# doi validation during the publication process.
PUBLICATION_DOI_REGEX = '({})'.format(REGEX_CHOICES)
PUBLICATION_DOI_REGEX += '(.\w+(.[0-9]+(.[0-9]{3,})?)?)?'
PUBLICATION_DOI_REGEX = r'({})'.format(REGEX_CHOICES)
PUBLICATION_DOI_REGEX += r'(\.\w+(\.[0-9]+(\.[0-9]{3,})?)?)?'
PUBLICATION_DOI_VALIDATION_REGEX = PUBLICATION_DOI_REGEX
DOI_DISPATCH_REGEX = '(?P<journal_tag>{})'.format(REGEX_CHOICES)
DOI_DISPATCH_REGEX += '(.(?P<part_1>\w+)(.(?P<part_2>[0-9]+)(.(?P<part_3>[0-9]{3,}))?)?)?'
DOI_DISPATCH_REGEX = r'(?P<journal_tag>{})'.format(REGEX_CHOICES)
DOI_DISPATCH_REGEX += r'(\.(?P<part_1>\w+)(\.(?P<part_2>[0-9]+)(\.(?P<part_3>[0-9]{3,}))?)?)?'
DOI_ISSUE_REGEX = '(?P<doi_label>({}).\w+(.[0-9]+)?)'.format(REGEX_CHOICES)
DOI_ISSUE_REGEX = r'(?P<doi_label>({})\.\w+(\.[0-9]+)?)'.format(REGEX_CHOICES)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment