Group:  Microsoft Word » microsoft.public.word.newusers
Thread: Searching for either a character or no character

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Searching for either a character or no character
"Larry" <larry328NOSPAM[ at ]att.net> 09.07.2006 01:21:45
Let's say I want to search for all instances of "its" and "it's" in a document. I could do that with two searches, one for "its" and one for "it's." But can I search for them with one search? For that I would need search parameters that would be either one character (the apostrophe) or no character. I don't see any way in Word to do that.

It would need to be something like this:

it['[no character]]s

I use Word 97.

Thanks.
Larry
Re: Searching for either a character or no character
"Graham Mayor" <gmayor[ at ]REMOVETHISmvps.org> 09.07.2006 04:48:03
Search for
<[Ii]t['s]{1,2}
or
<it['s]{1,2}
with the wildcard option set -
http://www.gmayor.com/replace_using_wildcards.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Larry wrote:
[Quoted Text]
> Let's say I want to search for all instances of "its" and "it's" in a
> document. I could do that with two searches, one for "its" and one
> for "it's." But can I search for them with one search? For that I
> would need search parameters that would be either one character (the
> apostrophe) or no character. I don't see any way in Word to do that.
>
> It would need to be something like this:
>
> it['[no character]]s
>
> I use Word 97.
>
> Thanks.
> Larry


Re: Searching for either a character or no character
"Larry" <larry328NOSPAM[ at ]att.net> 09.07.2006 16:22:24
Thank you. Clever. It would never have occurred to me to combine the [xy] syntax with the {1,2} syntax.

I also want to find occurrences of the word that have smart apostophes, so I added the smart apostrophe and also added the end of word mark:

<[Ii]t['’s]{1,2}>

Now a single search stops at every possible form of its and it's:

it's and it’s and It's and It’s and its and Its.

Thanks again.

Larry


"Graham Mayor" <gmayor[ at ]REMOVETHISmvps.org> wrote in message news:%23219AYxoGHA.4660[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> Search for
> <[Ii]t['s]{1,2}
> or
> <it['s]{1,2}
> with the wildcard option set -
> http://www.gmayor.com/replace_using_wildcards.htm
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> Larry wrote:
> > Let's say I want to search for all instances of "its" and "it's" in a
> > document. I could do that with two searches, one for "its" and one
> > for "it's." But can I search for them with one search? For that I
> > would need search parameters that would be either one character (the
> > apostrophe) or no character. I don't see any way in Word to do that.
> >
> > It would need to be something like this:
> >
> > it['[no character]]s
> >
> > I use Word 97.
> >
> > Thanks.
> > Larry
>
>
Re: Searching for either a character or no character
Bob S <notarealaddress[ at ]110.net> 26.07.2006 21:47:29
Nice trick!

Before you turn it loose replacing things in your document, be aware
that it will also hit "it'd" and "it'll" if they happen to be present.

Bob S



On Sun, 9 Jul 2006 07:48:03 +0300, Graham Mayor wrote:

[Quoted Text]
>Search for
><[Ii]t['s]{1,2}
>or
><it['s]{1,2}
>with the wildcard option set -
>http://www.gmayor.com/replace_using_wildcards.htm

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net