I want to search, in the middle of some other stuff, for:
either an "A" _or_ one or two spaces _or_ nothing.
i.e. my text can be any of:
xxxxAxxxx
xxxx xxxx
xxxx xxxx
xxxxxxxx
Logically, I'd put A{0,2}|/s{0,2} in there, but it really doesn't like
that.
Any suggestions? Or better places to look?
Cheers,
Andy D 2 937
Personally, when it comes to regular expressions, I suck.
You may want to try playing with The Regulator: http://sourceforge.net/projects/regulator/
It's a little rough around the edges, but I've found it an excellent tool
for helping me to build working regular expressions.
Hope you find it helpful.
Pete
"Andrew Ducker" <an****@ducker.org.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com... I want to search, in the middle of some other stuff, for: either an "A" _or_ one or two spaces _or_ nothing.
i.e. my text can be any of: xxxxAxxxx xxxx xxxx xxxx xxxx xxxxxxxx
Logically, I'd put A{0,2}|/s{0,2} in there, but it really doesn't like that.
Any suggestions? Or better places to look?
Cheers,
Andy D
Hi Andrew,
[A]{1}|[\s]{1,2}
NOTE: You can't match *nothing.* Everything matches nothing.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
"Andrew Ducker" <an****@ducker.org.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com... I want to search, in the middle of some other stuff, for: either an "A" _or_ one or two spaces _or_ nothing.
i.e. my text can be any of: xxxxAxxxx xxxx xxxx xxxx xxxx xxxxxxxx
Logically, I'd put A{0,2}|/s{0,2} in there, but it really doesn't like that.
Any suggestions? Or better places to look?
Cheers,
Andy D This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Harry |
last post by:
Hi there,
does anyone know how I can build a regular expression e.g. for the
string.search() function on runtime, depending on the content of
variables? Should be something like this:
var...
|
by: Dimitris Georgakopuolos |
last post by:
Hello,
I have a text file that I load up to a string. The text includes
certain expression like {firstName} or {userName} that I want to match
and then replace with a new expression. However,...
|
by: James D. Marshall |
last post by:
The issue at hand, I believe is my comprehension of using regular
expression, specially to assist in replacing the expression with other text.
using regular expression (\s*) my understanding is...
|
by: Billa |
last post by:
Hi,
I am replaceing a big string using different regular expressions (see
some example at the end of the message). The problem is whenever I
apply a "replace" it makes a new copy of string and I...
|
by: Pete Davis |
last post by:
I'm using regular expressions to extract some data and some links from some
web pages. I download the page and then I want to get a list of certain
links.
For building regular expressions, I use...
| |
by: LordHog |
last post by:
Hello all,
I am attempting to create a small scripting application to be used
during testing. I extract the commands from the script file I was going
to tokenize the each line as one of the...
|
by: Mike |
last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in
matches. I would like to get what the actual regular expression is.
In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
|
by: shawnmkramer |
last post by:
Anyone every heard of the Regex.IsMatch and Regex.Match methods just
hanging and eventually getting a message "Requested Service not
found"?
I have the following pattern:
^(?<OrgCity>(+)+),...
|
by: sunil |
last post by:
Hi,
Am writing one C program for one of my module and facing one problem
with the regular expression functions provided by the library libgen.h
in solaris.
In this library we are having two...
|
by: Shawn B. |
last post by:
Greetings,
I'm using a custom WebBrowser control:
http://www.codeproject.com/KB/miscctrl/csEXWB.aspx
When I get the DocumentSource of a web page I browsed, and run a regular
expression...
|
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,...
| |
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,...
|
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...
|
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,...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |