In python, I'm compiling a regular expression pattern like so:
rule_remark_pattern = re.compile('access-list shc-[(in)(out)] [(remark)(extended)].*')
I would expect it to match any of the following lines:
access-list shc-in remark C883101 Permit http from UPHC outside to Printers inside
access-list shc-in extended permit tcp object-group UPHC-Group-Outside object-group PRINTER-Group-Inside object-group http-https
access-list shc-out remark C890264 - Permit (UDP 123) from UPHC-Group-Inside to metronome.usc.edu
access-list shc-out extended permit udp object-group UPHC-Group-Inside host 68.181.195.12 eq ntp
Unfortunately, it doesn't match any of them. However, if I write the regular expression as:
rule_remark_pattern = re.compile('access-list shc-in [(remark)(extended)].*')
It matches the first 2 just fine.
Similarly, if I write:
rule_remark_pattern = re.compile('access-list shc-out [(remark)(extended)].*')
It matches the last 2.
Anybody know what's going on here?