#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.

Mastering Python Regular Expressions
Buying options
View on Amazon.com
or
Specs:
Release dateFebruary 2014

idea-bulb Interested in what Redditors like? Check out our Shuffle feature

Shuffle: random products popular on Reddit

Found 2 comments on Mastering Python Regular Expressions:

u/mwtillotson ยท 2 pointsr/learnpython

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:

  • Pattern 'str' found in straight.
  • Pattern 'thr' found in through.