#4,261 in Computers & technology books
Reddit mentions of Mastering Python Regular Expressions
Sentiment score: 1
Reddit mentions: 2
We found 2 Reddit mentions of Mastering Python Regular Expressions. Here are the top ones.
Buying options
View on Amazon.comor
Specs:
Release date | February 2014 |
http://www.amazon.com/gp/product/B00IM5UW3U
I am by no means a pro when it comes to regular expressions, though I am boring enough to have read through Mastering Python Regular Expressions which is pretty decent.
However, the site you linked to looks great, in so far as it adheres to Python's regex formatting (it seems to at first glance). I didn't know about this -- thanks (favorited).
Although nothing quite beats trying it out with real code like you've been doing. Only then will you run into oddities like trying to combine the syntax with "".format as we saw. And probably only through experimenting would you recognize the usefulness of grouping:
pattern = "([" + consonants + "]{3})\w*"
for word in list1:
match = re.match(pattern, word)
if match:
print("Pattern '{}' found in {}.".format(match.groups()[0], word))
Which would yield the following with your list of words: