473,405 Members | 2,160 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,405 software developers and data experts.

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 1070
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
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,...
2
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,...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
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...

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.