Open utterances-bot opened 5 years ago
Wouldn't this fail to match an occurrence that had a period after the word after "the"? For example, in the article at one point the author says "I was all for changing the name." and 'the name' doesn't appear on your list of results, I think because a period isn't a character in regex (I honestly don't know, am trying to learn regex now).
@region3 yes, you're right. The \s+
at the end of the regex means there needs to be a space after the word. You could change it to look for a space or a period or maybe \b
would work better instead.
Python finditer regular expression example - SaltyCrane Blog
https://www.saltycrane.com/blog/2007/10/python-finditer-regular-expression/