Re: Find & Replace Question
- From: "Lee" <lsilver@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 2 Dec 2006 10:56:46 -0800
Dave:
Yeah, on the syntax, ~ should have been ^ -- that's what I get for
posting un-tested code.
OTOH, I just tried [^&]&[^&] and it works as advertised -- it finds &'s
that are not also &&'s. This works in VS 2005; but I don't know about
VS2003.
Based on what the OP wanted, I would probably modify the RE to
[^&]&[^=&] in order to bypass the &= operator.
--
// Lee Silver
// Information Concepts Inc.
Dave Sexton wrote:
Hi Lee,
Good idea (incorrect syntax though). Based off that pattern I got this to
work:
&~([&:b])
However, it will match the last "&" in "&&" when it's not immediately
followed by a space or tab. In other words, the pattern matches "&", and
the last "&" in "&&", but not, "&& ".
I thought it might be acceptable since it's common for && to be followed by
at least one space in code. If you can't guarantee that, then the pattern
will not work for you.
Just FYI,
[^&]&[^&] and ~(&)&~(&)
didn't work for me, unfortunately.
HTH
--
Dave Sexton
"Lee" <lsilver@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1165075827.716564.276240@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The following untested RegExp might work:
[~&]&[~&]
It should find an & that is neither preceded nor followed by an &.
--
// Lee Silver
// Information Concepts Inc.
inpuarg wrote:
I want to find a & character using Regex. But not &&
How can i manage this in c# Quickfind window ?
--------------------------------------------------
ne kadar yaþarsan yaþa
sevdiðin kadardýr ömrün :(
--------------------------------------------------
.
- Follow-Ups:
- Re: Find & Replace Question
- From: Dave Sexton
- Re: Find & Replace Question
- References:
- Find & Replace Question
- From: inpuarg
- Re: Find & Replace Question
- From: Lee
- Re: Find & Replace Question
- From: Dave Sexton
- Find & Replace Question
- Prev by Date: Re: converting system.dbnull to system.string
- Next by Date: Re: How to generate a alpha a - z randomly
- Previous by thread: Re: Find & Replace Question
- Next by thread: Re: Find & Replace Question
- Index(es):
Relevant Pages
|