import re # minimal example constructed by @erik-krogh baz = re.compile(r'\+0') # examples from LGTM.com re.compile(r'.*\+0x(?P[0-9a-f]+)$') re.compile(r"^\<.*\+0x.*\>$") re.search(r'^(https?://.*/).+\-0+\.ts$', res, re.MULTILINE) re.compile('\s+\+0x[0-9a-f]+\s*(.*)') re.compile("(.*)\+0x([a-f0-9]*)") LOG_PATTERN = { 'vumi': re.compile( r'(?P[\d\-\:\s]+)\+0000 .* ' r'Inbound: '), 'smpp_inbound': re.compile( r'(?P[\d\-\:\s]+)\+0000 .* ' r'PUBLISHING INBOUND: (?P.*)'), 'smpp_outbound': re.compile( r'(?P[\d\-\:\s]+)\+0000 .* ' r'Consumed outgoing message '), 'dispatcher_inbound_message': re.compile( r'(?P[\d\-\:\s]+)\+0000 Processed inbound message for [a-zA-Z0-9_]+: (?P.*)'), 'dispatcher_outbound_message': re.compile( r'(?P[\d\-\:\s]+)\+0000 Processed outbound message for [a-zA-Z0-9_]+: (?P.*)'), 'dispatcher_event': re.compile( r'(?P[\d\-\:\s]+)\+0000 Processed event message for [a-zA-Z0-9_]+: (?P.*)'), } re.compile( '(.*)(?P\#[0-9]+ 0x[0-9a-f]{8,16}) ' '(?P[^+]+)\+0x(?P
[0-9a-f]{8,16})' '(?P)(?P)') RE_LINE = re.compile( r'(?P[^ ]+) ' r'(?P[^ ]+) ' r'(?P[^ ]+) ' r'(?P[^ ]+) ' r'\[(?P[^\]]+) \+0000\] ' r'"(?P[^ ]+) /(?P[^ /?]+)(?P[^ ]*) HTTP/[^"]+" ' r'(?P\d+) ' r'(?P\d+) ' r'"(?P[^"]*)" ' r'"(?P[^"]*)"' r'(?P.*)' ) re.compile('(?P\#[0-9]+ 0x[0-9a-f]{8,8}) ' '(?P[^+]+)\+0x(?P[0-9a-f]{8,8})') re.compile( '(.*)(?P\#[0-9]+ 0x[0-9a-f]{8,16}) ' '(?P[^+]+)\+0x(?P
[0-9a-f]{8,16})' '(?P)(?P)') re.match(r'^@@ -1.* \+0,0 @@', self.hdr) re.compile('(.*)(?P\#[0-9]+ 0x[0-9a-f]{8,16}) ' '(?P[^+]+)\+0x(?P
[0-9a-f]{8,16})' '(?P)(?P)')