I\'m currently trying to make a regex that will find all the sentences in a block of text, and so far I\'ve got this;
(?=(?
What about this:
import re
pattern = r'(?=(?
sentences will be a list containing the resulting substrings.
re.split will split text_block up into different elements of the returned list. It splits at each point where pattern matches.
Read about re here:
https://docs.python.org/2/howto/regex.html
EDIT(data imported from your closed newer question):
If you are getting the symbols like ?, ! etc. captured into your returned list aswell, you should try removing the outer parens, like this:
re.split(r"\.(?
Ex:
sentences = [s for s in re.split(r"\.(?