hi i have to finish my assignment by tonight and am stuck when trying to make a regular expression that splits a big slab of text into sentences.
I am using the .split() function and want it to split on '.' , '?' , '!' , and '\n'
but also if there is more than 1 \n in a row or a ./?/! followed by \n to have the senteces split as they should ie.
"It went on for five minutes without stopping. And by the time the sheep
had quieted down, the chance to utter any protest had passed, for the pigs
had marched back into the farmhouse.
Benjamin felt a nose nuzzling at his shoulder."
should return;
s[0] = "It went on for five minutes without stopping"
s[1] = "And by the time the sheep had quieted down, the chance to utter any protest had passed, for the pigs had marched back into the farmhouse"
s[2] = "Benjamin felt a nose nuzzling at his shoulder"
If someone could please give me the expression and an explanation of how it is constructed it would be greatly appreated.
Thanks mick.