regex.py 908 Bytes
Newer Older
1
# *-* coding: utf-8 *-*
2
""" A collections of regular expression defining rules to be applied  
3 4 5 6 7 8 9 10 11 12 13 14 15
on field contents.

@author: R. Le Gac

"""
# Collaboration field:
#  - CMS Collaboration
#  - CMS and LHCb Collaborations
#  - ATLAS Collaboration, CMS Collaboration
#  - Heavy Flavour Averaging Group 
#  - CTA Consortium
#  - any mixture of the above separated by a comma
#
16 17
REG_COLLABORATION = r'^[A-Za-z0-9\-/, ]+([Cc]ollaboration|[Cc]onsortium|[Gg]roup)[s]?$'

18
# Conference dates
19
#   - 3 Dec 2012
20 21 22
#   - 10-14 Dec 2012
#   - 28 Jun - 4 Jul 2012
#
23 24 25 26
reg1 = r'\d{1,2} [A-Z][a-z]{2} \d{4}'
reg2 = r'\d{1,2}-\d{1,2} [A-Z][a-z]{2} \d{4}'
reg3 = r'\d{1,2} [A-Z][a-z]{2} - \d{1,2} [A-Z][a-z]{2} \d{4}'
REG_CONF_DATES = r'%s|%s|%s' % (reg1, reg2, reg3)
27 28 29 30 31 32 33

# Defence date
#  - 30 Dec 2012
#
REG_DEFENSE = r'\d{2} [A-Z][a-z]{2} \d{4}'

# Submitted field
34 35
#  - 2012-12
#  - 2012-12-31
36
#
37
REG_SUBMITTED = r'\d{4}-\d{2}(-\d{2})?'