Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The (?:...) notation should be fairly popular; with it, you can group
- parts of a regex, but it does not save them for future retrieval or use. This
- comes in handy when you don’t want superfluous matches that are saved
- and never used:
- >>> re.findall(r'http://(?:\w+\.)*(\w+\.com)',
- ...
- 'http://google.com http://www.google.com http://
- code.google.com')
- ['google.com', 'google.com', 'google.com']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement