regex.py 844 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 19 20 21 22
# Conference dates
#   - 10-14 Dec 2012
#   - 28 Jun - 4 Jul 2012
#
reg1 = r'\d{1,2}-\d{1,2} [A-Z][a-z]{2} \d{4}'
23
reg2 = r'\d{1,2} [A-Z][a-z]{2} - \d{1,2} [A-Z][a-z]{2} \d{4}'
24 25 26 27 28 29 30 31
REG_CONF_DATES = r'%s|%s' % (reg1, reg2)

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

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