Regular Expression problem

  • Thread starter Thread starter Andrew Ducker
  • Start date Start date
A

Andrew Ducker

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
 
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
 
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
 
Back
Top