octal values: simpler test for match objects
From the Python 3 documentation: Match objects always have a boolean value of True. Since match() and search() return None when there is no match, you can test whether there was a match with a simple if statement: match = re.search(pattern, string) if match: process(match)pull/487/head
parent
6b6fdba3bf
commit
e319a17344
Loading…
Reference in New Issue