symbols for end of sentences
Posted: Wed Jan 16, 2008 1:21 pm
Hi, I need a regex that splits a string on every delimiter that symbolizes the end of a sentence, at the moment used delimiters are:
. ! ? : ; and cause of rest of code requirements I need \n to be a delimiter to.
Also I need those to be able to be repeated, for example: ... should be treated as ONE delimiter not 3 of the same, same goes for ??? !!!!!! :::::: etcetera.
For the difficult part, I need smileys to be delimiters aswell, smileys such as :) :P :p :D :d :s :S =) =D =P =p
basically every common smiley.
At the moment I'm using this regex: /([.\n?!:;]+)+/ which as far as I've tested works fine, although the smileys are not included, I just don't know how to do it. Help!
. ! ? : ; and cause of rest of code requirements I need \n to be a delimiter to.
Also I need those to be able to be repeated, for example: ... should be treated as ONE delimiter not 3 of the same, same goes for ??? !!!!!! :::::: etcetera.
For the difficult part, I need smileys to be delimiters aswell, smileys such as :) :P :p :D :d :s :S =) =D =P =p
basically every common smiley.
At the moment I'm using this regex: /([.\n?!:;]+)+/ which as far as I've tested works fine, although the smileys are not included, I just don't know how to do it. Help!