Skip to content Skip to sidebar Skip to footer

Python Regex Punctuation Recognition

I am stumped by this one. I am just learning regular expressions and cannot figure out why this will not return punctuation marks. here is a piece of the text file the regex is par

Solution 1:

After minimizing your example we have:

re.findall(r"/\,\b", "/NN ,/, breeding/VBG Lilacs/NNP out/RB of/IN the/DT dead/JJ land/NN")

And it does not match for obvious reasons: there is no beginning of the word immediately after the comma.

Post a Comment for "Python Regex Punctuation Recognition"