473,800 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

having problems capturing all text possibilites.

Hi I'm trying to fix an expression, to grab all sets of 2 words with a
space between them, ie: hello word (valid) C# sample (Valid) hello.
world (Invalid) hello world. (invalid) <-- need to stop capture before
the "." and cannot use \b since \b includes "#"

this is the expression I am trying to work with, so far it takes each
word fine seperately, but it does not take into account hello. world
and it captured hello world.
(([\x23\x41-\xff]*\x2e?[\x23\x41-\xff]+)(?:[\x21-\x2f\x41-\xff])?\s([\x23\x*41-\xff]*\x2e?[\x23\x41-\xff]+)(?:[\x21-\x2f\x41-\xff])?)

the other problem is that it only takes pares sequentially,
I would need to have it do the follwing
hello world this is time
(hello word) (world this) (this is) (is time)
can anyone help me out.
Best Regards,
Alexandre Brisebois
http://www.pointnetsolutions.com

Mar 8 '06 #1
2 1087
Is there a particular reason why you need to use a single Regex for
this when applying two or three Regex expressions in code would work
better? By that I mean, match a word, match spaces after it, then match
another word, then start again from the beginning of the second word?

Trying to do it all in one go just seems unnecessarily difficult to me.

Mar 9 '06 #2
I have solve the problem with queue type adt
and I just feed words one by one into them,
and simply call a overriden ToString()

works pretty well actually.
so I am working by grabbing each word one by one.
I still have some problems though so I will look info refining
the way I clean html out of files and a list of specific characters

then I match single words...

still needs optimization though.

Best Regards,
Alexandre Brisebois

Mar 10 '06 #3

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

Similar topics

4
2797
by: Krishna Kumar | last post by:
Hai all, I am doing a project in .net and in that project I have a problem in capturing text from an image. i.e images like CAPTCHA images . which has inbuilt text with in the image.So, Can any one suggest me how to continue my work or give their valuable suggestions for capturing text in the CAPTCHA image . yours KrishnaKumar
2
2818
by: GS | last post by:
How can one avoid capturing leading empty or blank lines? the data I deal with look like this "will be paid on the dates you specified. xyz supplier amount: $100.52 when: September 07, 2007 reference #: 0415 from: operating account
2
1678
by: meetu3181 | last post by:
Hi All, I am new to perl.I need to parse a text file in unix which is having data like this .I need to to store each value in a seperate variable. The TXT FILE TO BE PARSED: HTTP_PORT = 7779 SSL = FALSE User = beeadmin Password = Welcome1 Enterprise_Name = US
0
9695
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9555
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10260
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7588
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6826
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5479
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4156
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 we have to send another system
2
3770
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2956
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.