Link to home
Start Free TrialLog in
Avatar of sparky74
sparky74

asked on

ASP - Regex to get sentences from block of text

Hi

I have stored some reviews and need to take a snippet of them, ideally I was looking for a way to extract the first 2 sentences from each block of text.

I can manage to extract the first sentence using the code below, but cant get the 2nd for some reason

please can you help and advice
dim regEx, replacementstring
Set regEx = New RegExp
regEx.IgnoreCase = true
regEx.Global = false
regEx.Pattern = "[^\.]+[^\.]"
Set Matches  = regEx.Execute("I have never before so to be fair I cannot compare this with other products on the market. I love styling - it looks like a ray gun sci-fi movie! The suction of this size and I have found the compact size means you are more inclined to use it. It quickly so for example if you were to vac all the small bits in a double size room such as my kitchen diner it expect to do the whole house in one go! I also doubt that it would adequately clean your car interior on one charge. use from one charge which takes about three hours. I think this a backup for your main vac and saves hauling a heavy machine out for a small clean up. It s a shame they don t provide a such as you would get with a drill.")
For Each Match in Matches   ' Iterate Matches collection.
    Response.Write(Match.Value)
Next

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sybe
sybe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sparky74
sparky74

ASKER

thank you sybe. I had not used the split function before. This is great and very easy to understand and works a treat!