The re Module for Regular Expressions in Python


Use regular expressions for powerful string matching and manipulation.

Source Code

import re
pattern = re.compile(r'bfoob')
matches = pattern.findall('foo bar (foo) bar foo-bar foo_bar')
for match in matches:
    print("Found:", match)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments