Hi everyone,
I need a help in creating a regular expression, I need to select only "Sentences" in String using Regex so I wrote the Code ..
boost::regex re( "(\\S.+?[.!?])(?=\\s+|$)" );
This code considers that sentences break at any of these three characters . ! ?
but this code considers string "Mr. Obama" as 2 difference sentences (being a dot character in between), where as I want it to be only one sentence.
I have a got a string vector of all the words which have to excluded.
std::vector<std:string>exceptionVector;
exceptionVector.pushback("Mr.")
exceptionVector.pushback("Dr.")
exceptionVector.pushback("Mrs.")
Now in my regex, I want that if any of the words occur from my vector, it should NOT be a seperate sentence.
Any idea how can I create this Regular expression
Thanks in Advance
-Subhash