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/489/head
parent
6a9d20c53e
commit
8a540c2bbf
Loading…
Reference in New Issue