473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

RegEx help pls

I am trying to find the sentence for which a particular word exists in and
have this expression:

([^>]*>)?country.+?(<|\.)

In this example, I want it to find all sentences with the word "country" in
it. So far, it finds a sentence but from the word "country" to the end of
the sentence, but I can't figure out how to get the characters from the
start of the sentence to the word "country". Can someone pls help me?

Here is my sample data:

<p9>
Frequently Asked Questions (FAQs)
<p10>


<p11>
Flags of the World.
<p12>
Gallery of Covers
<p13>
Text/Low Bandwidth Version
<p14>
<p15>
Download This Publication
<p16>
Submit a Factual Update
<p17>
Search The World Factbook
<p18>
<p19>
What's New
<p20>
- Country information has been updated as of 9 August, 2005.
<p21>
- There have been some significant changes to the latest edition of The
World Factbook.
Recent confirmation that the United Kingdom Government administers the
Sovereign Base
Areas of Akrotiri and Dhekelia on Cyprus as dependencies (and not as lease
areas like
the US Guantanamo Bay Naval Station in Cuba) has required a changing of
their
status and their addition to the Factbook as new entities. In addition, the
European
Union has been included as an "Other" entity at the end of the listing. The
European
Union continues to accrue more nation-like characteristics for itself and so
a separate
listing was deemed appropriate. A fuller explanation may be found under the
European
Union Preliminary statement.
<p22>
- Along with the new entities and the regular information updates, The World
Factbook
now also features six new fields. In the People category, a Major infectious
diseases field
has been added for countries deemed to pose a higher degree of risk for
travelers. In the
Economy category, entries have been added for Current account balance,
Investment
(gross fixed), Public debt, and Reserves of foreign exchange and gold. The
Transnational
issues category has a new Refugees and internally displaced persons entry.
<p23>

--
|
+-- Thief_
|
Nov 21 '05 #1
2 1078
Thief,

If I understand your problem right, is the most optimal method in VBnet for
this the microsoft.visualbasic.dll 'Find'.

We have discussed this in this newsgroup in a test in october 2003 where I
made a program with some simple tests.

If you want to reread that thread.

http://groups.google.com/group/micro...5c33cc87237dbf

I hope this helps,

Cor
Nov 21 '05 #2
Thief,

If I understand your problem right, is the most optimal method in VBnet for
this the microsoft.visualbasic.dll 'Find'.

We have discussed this in this newsgroup in a test in october 2003 where I
made a program with some simple tests.

If you want to reread that thread.

http://groups.google.com/group/micro...5c33cc87237dbf

I hope this helps,

Cor
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tim Conner | last post by:
Is there a way to write a faster function ? public static bool IsNumber( char Value ) { if (Regex.IsMatch( Value.ToString(), @"^+$" )) { return true; } else return false; }
6
by: Extremest | last post by:
I have a huge regex setup going on. If I don't do each one by itself instead of all in one it won't work for. Also would like to know if there is a faster way tried to use string.replace with all...
7
by: Extremest | last post by:
I am using this regex. static Regex paranthesis = new Regex("(\\d*/\\d*)", RegexOptions.IgnoreCase); it should find everything between parenthesis that have some numbers onyl then a forward...
3
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def...
15
by: morleyc | last post by:
Hi, i would like to remove a number of characters from my string (\t \r \n which are throughout the string), i know regex can do this but i have no idea how. Any pointers much appreciated. Chris
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.