I have been trying to employ a regular expression to grab sentences from the following paragraph:
str="Hello, my name is Mr. Bob. How are you? I am in the F.B.I. My favorite number is 2.5."
var res = str.match( /[^\.!\?]+[\.!\?]+/g );
console.log(res);
Here is the result:
["Hello, my name is Lance.", " How are you?", " I am in the F.", "B.", "I.", " My favorite number is 2.", "5."]
How can I capture "F.B.I." and "2.5" as words in a sentence and not a bunch of individual sentences?