Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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)
- Loading branch information