473,473 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

get sentences in paragraphs REGEX

16 New Member
i need to regex to get all the sentences within a paragraph... how will i do that?
tnx in advance
Apr 7 '09 #1
4 3991
BrianHjoellund
1 New Member
Depends on how the paragraphs are seperated. Is it HTML paragraphs (<p>), RTF (\par), or carriage return/line feed or something completly different?
Apr 8 '09 #2
cloud255
427 Recognized Expert Contributor
Well sentences are separated by a punctuation mark such as .!? and then have 2 white spaces after that. You can create a regex to look for one of those punctuation marks which is followed by 2 white spaces, but there is no guarantee that your users are using proper punctuation in their paragraphs...
Apr 8 '09 #3
faelnefal
16 New Member
how about words in paragraphs?

here is a sentence. this sentence shouldnt be here.
here is another sentence. this sentence must not also be present.
here is the next sentence.


i need the words between the sentences that has the words "here" and "sentence"

the result would be:
here is a sentence
here is another sentence
here is the next sentence
Apr 8 '09 #4
cloud255
427 Recognized Expert Contributor
@faelnefal
What about the " this sentence shouldnt be here." ?
It contains both the words "sentence" and "here".

What is suggest is that you search for the index of each ". " combination.
Create a substring up to that point, then use the string.Contains() function to see if it contains your keywords. If the order of the words matters then you have to compare the starting indexes of the key words to ensure that they are in the correct order.
Apr 8 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

75
by: Xah Lee | last post by:
http://python.org/doc/2.4.1/lib/module-re.html http://python.org/doc/2.4.1/lib/node114.html --------- QUOTE The module defines several functions, constants, and an exception. Some of the...
40
by: | last post by:
Could someone cite some offical rule or documentation with regard to the <P> tag? I've seen folks put it in between paragraphs... and others wrap it around a paragraph. I'd think to use it...
12
by: effendi | last post by:
Hi can anyone tell me what is the best way to determine the number of sentences that someone enter into a text area? Thanks in advanced.
3
by: FFMG | last post by:
Hi, I am looking for a way to compare 2 short paragraphs that are almost the same. Is there some kind of algorithm that would allow us to compare the two and return some kind of likely hood...
3
by: =?Utf-8?B?Qm9i?= | last post by:
How can I use RegEx to search for a number of strings and replace them with upper case versions of themselves? Thanks
4
by: Archanak | last post by:
Hi, I have a paragraph. my search words are in parenthesis (grouped together). for eq:- apple AND (mango OR orange) It should retrieve the sentences which has apple (is a must word)...
1
by: anglaissam | last post by:
I have a regex that is designed to help improve readability for a html document. "(?=((?!<\/?em).)*<\/em>) The purpose of this regex is to escape " marks from within <EM> affected sentences....
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.