## NEWLINES MUST BE INDICATED BY \n #########################################\n #\n # REG-EX \n #\n #########################################\n \n _year = '(?P-?((20\d\d))|(\d\d)(?!:))'\n _fullyear = '(?P-?\d+\d\d(?!:))'\n _year_epoch = '(?:' + _year + '(?P *[ABCDE\.]+)?)'\n _fullyear_epoch = '(?:' + _fullyear + '(?P *[ABCDE\.]+)?)'\n \n _month = '(?P[0-2]?\d(?!:))'\n _fullmonth = '(?P[01]\d(?!:))'\n \n _litmonth = ('(?Pjan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z,\.;]*')\n \n _day = '(?P[0123]?\d(?!:))'\n _usday = '(?P[0123]?\d(?!:))(?:st|nd|rd|th|[,\.;])?'\n _fullday = '(?P[0123]\d(?!:))'\n \n ############## RESTRICT DAY TO NOT BE YEAR\n _day = '(?P20(?![\d:])|(?!20)\d?\d(?!:))'\n _usday = _day + '(?:st|nd|rd|th|[,\.;])?'\n ############## RESTRICT DAY TO NOT BE YEAR\n \n _litday = ('(?Pmon|tue|wed|thu|fri|sat|sun)[a-z]*')\n \n _hour = '(?P[012]?\d)'\n _minute = '(?P[0-6]\d)'\n _second = '(?P[0-6]\d(?:\.\d+)?)'\n \n _days = '(?P\d*\d(?:\.\d+)?)'\n _hours = '(?P\d*\d(?:\.\d+)?)'\n _minutes = '(?P\d*\d(?:\.\d+)?)'\n _seconds = '(?P\d*\d(?:\.\d+)?)'\n \n _sign = '(?:(?P[-+]) *)'\n _week = 'W(?P\d?\d)'\n _zone = ('(?P[A-Z]+|[+-]\d\d?:?(?:\d\d)?)')\n _ampm = '(?P[ap][m.]+)'\n \n _time = '\D' +_hour + ':' + _minute + '(?::' + _second + ')? *' + _ampm + '? *' + _zone + '?' + '\D'\n _isotime = '\D' + _hour + ':' + _minute + ':' + _second + '? *' + _zone + '?' + '\D'\n _dottime = '\D' + _hour + '\.' + _minute + '\.' + _second + ' *' + _zone + '?' + '\D'\n \n _eurodate = _day + '\.' + _month + '\.' + _year_epoch + '?' \n #_usdate = _month + '/' + _day + '(?:/' + _year_epoch + ')?' + '[^0-9\.]' # added + '[^0-9\.]' to prevent .6/5. in errors as being months\n _usdate = _month + '/' + _day + '(?:/' + _year_epoch + ')?' + '[^0-9a-z\.]' # added + '[^0-9\.]' to prevent .6/5. in errors as being months\n _altusdate = _month + '-' + _day + '-' + _fullyear_epoch \n _isodate = _year + '-' + _fullmonth + '-?' + _fullday + '?(?!:)'\n _altisodate = _year + _fullmonth + _fullday + '(?!:)'\n _altlitdate = ('(?:'+ _litday + ',? )? *' + _litmonth + '[ ,.]+' + _usday + '(?:[ a-z]+' + _year_epoch + ')?')\n _litdate = ('(?:'+ _litday + ',? )? *' + _usday + ' *' + '[- /] *(?:' + _litmonth + '|'+ _month +') *[- /] *' + _year_epoch + '?')\n _eurlitdate = ('(?:'+ _litday + ',?[ a-z]+)? *' + '(?:'+ _usday + '[ a-z]+) *' + _litmonth + '(?:[ ,.a-z]+' + _year_epoch + ')?')\n _dotdate = _year + '\.' + _month + '\.' + _day\n \n _restrictedDay = '(?:[^:0-9]|^)(?P\d{1,2})(?:[^:0-9]|$)'\n _restrictedFullday = '(?:[^:0-9]|^)(?P\d{2})(?:[^:0-9]|$)'\n _restrictedUsday = _restrictedDay + '(?:st|nd|rd|th|[,\.;])?'\n _litdate = ('(?:'+ _litday + ',? )? *(?:[^.:0-9]|^)' + _usday + '(?:[^:0-9]|[ /-]) *(?:' + _litmonth + '|'+ _month +') *[- /] *' + _year_epoch )\n _ascdate = ('(?:'+ _litday + ',? )? *' + _restrictedUsday + ' *' + '[- /] *(?:' + _litmonth + ') *[- /]' + '(?:[0-9: ]+)' + _year_epoch + '?')\n _isodatelit = _year + '[/-]' + _litmonth + '[/-]' + _fullday + '(?!:)'\n \n ########################################################\n # #\n # PUBLIC VARIABLES. THESE VARIABLES *MUST* BE DEFINED #\n # #\n ########################################################\n \n ## TO ADD MORE TIME/DATE FORMATS, CREATE REGEX AND ADD TO timePatterns and datePatterns LIST\n ## DATES AND TIME STRINGS ARE MATCHED AGAINST THE EXPRESSIONS IN THE ORDER THEY ARE DEFINED IN THE BELOW PATTERNS\n timePatterns = [_time, _isotime, _dottime]\n datePatterns = [_usdate, _altusdate, _litdate, _altlitdate, _isodate, _ascdate, _eurlitdate, _altisodate, _eurodate, _isodatelit, _dotdate]\n \n # SPEED OPTIMIZATION. ONLY PROCESS 1 OUT OF N LINES FOR TIMESTAMPING\n processEveryNLines = 1\n # DATES OUTSIDE THIS RANGE WILL BE ASSUMED TO BE A MISTAKE\n minYear = 2000\n maxYear = 2014\n \n