MSGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Wildcard Find and Replace in Word 2004

• Follow

```I am working on some tests and evaluations where the author did not
use numerals and tabs correctly.

I want to be able to use a wildcard search to find, for example "1.
^t^t" and replace it with "^t1.^t" and the "1" would whatever number
from 0-9. In other words, I want to search once, then do a replace
that will fix the formatting of the tabs and keep the numbers the
same.

Can this be done?
```
 0

```Yes, it can be done.

Now, let's see if I can remember how... :-)

Ah hah!  I knew I had this somewhere...

Find What is:

([0-9].)(^t^t)

Replace with is:

^t\1^t

And "Use Wildcards" must be turned on.

What this does is divide the find into two regular expressions, using ( and
).

The first expression finds any SINGLE digit 0 to 9 followed by a period.
The second expression finds the two consecutive tabs.

Then in the Replace, we add a tab, whatever the first Find expression found,
and another tab.  We discard the result of the second find expression (the
two tabs).

If your number series exceeds one digit, you need to double the [0-9] in the
first expression and run that first to do all the two-digit numbers, then
remove that and run again to do the single digit numbers.  If you try to do
the singles first and then the doubles, you'll break it :-)

Hope this helps

On 24/11/09 10:13 AM, in article
"Fogharty" <fogharty@lycos.com> wrote:

> I am working on some tests and evaluations where the author did not
> use numerals and tabs correctly.
>
> I want to be able to use a wildcard search to find, for example "1.
> ^t^t" and replace it with "^t1.^t" and the "1" would whatever number
> from 0-9. In other words, I want to search once, then do a replace
> that will fix the formatting of the tabs and keep the numbers the
> same.
>
> Can this be done?

--

Mactopia is currently broken: the helpers are not seeing any of the
questions being posted.  Microsoft is working on the problem.  In the
meantime:

To successfully post in here, either use Google:

Or Microsoft Communities:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=micros
oft.public.mac.office.word&cat=en_US_3cf8ecf1-ca81-4391-b07d-8933029ee8a9&la
ng=en&cr=US

Or in Entourage, use the pre-configured Microsoft News server:
See "setting up Entourage for Newsreading" here:
http://word.mvps.org/Mac/AccessNewsgroups.html

matters unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:john@mcghie.name

```
 0

```What would I do without you John!

A couple of things I've discovered:

I can't just copy and paste the search terms from my browser to my
Find dialog in Word... it only works if I type it in by hand.

I had to tweak the Replace
^t\1^t
With
^t\1.^t
to keep the decimal point there.

But otherwise... goodness! This will save me  a load of time.

Now if I can get my other problem fixed, I'll be good to go!

Thanks!

On Nov 23, 7:30=A0pm, John McGhie <j...@mcghie.name> wrote:
> Yes, it can be done.
>
> Now, let's see if I can remember how... :-)
>
> Ah hah! =A0I knew I had this somewhere...
>
> Find What is:
>
> ([0-9].)(^t^t)
>
> Replace with is:
>
> ^t\1^t
>
> And "Use Wildcards" must be turned on.
>
> What this does is divide the find into two regular expressions, using ( a=
nd
> ).
>
> The first expression finds any SINGLE digit 0 to 9 followed by a period.
> The second expression finds the two consecutive tabs.
>
> Then in the Replace, we add a tab, whatever the first Find expression fou=
nd,
> and another tab. =A0We discard the result of the second find expression (=
the
> two tabs).
>
> If your number series exceeds one digit, you need to double the [0-9] in =
the
> first expression and run that first to do all the two-digit numbers, then
> remove that and run again to do the single digit numbers. =A0If you try t=
o do
> the singles first and then the doubles, you'll break it :-)
>
> Hope this helps
>
```
 0

```The Replace should not have needed tweaking :-)

The "\1" replaces "Whatever was found".  So check your "Find What" to ensure
that you have included the decimal point inside the parentheses, so that it
becomes one of the "found" characters.

Otherwise, this thing will fire on "any digit" and you don't want that :-)

Cheers

On 25/11/09 4:13 AM, in article
"Fogharty" <fogharty@lycos.com> wrote:

> What would I do without you John!
>
> A couple of things I've discovered:
>
> I can't just copy and paste the search terms from my browser to my
> Find dialog in Word... it only works if I type it in by hand.
>
> I had to tweak the Replace
>  ^t\1^t
> With
> ^t\1.^t
> to keep the decimal point there.
>
> But otherwise... goodness! This will save me  a load of time.
>
> Now if I can get my other problem fixed, I'll be good to go!
>
> Thanks!
>
> On Nov 23, 7:30�pm, John McGhie <j...@mcghie.name> wrote:
>> Yes, it can be done.
>>
>> Now, let's see if I can remember how... :-)
>>
>> Ah hah! �I knew I had this somewhere...
>>
>> Find What is:
>>
>> ([0-9].)(^t^t)
>>
>> Replace with is:
>>
>> ^t\1^t
>>
>> And "Use Wildcards" must be turned on.
>>
>> What this does is divide the find into two regular expressions, using ( and
>> ).
>>
>> The first expression finds any SINGLE digit 0 to 9 followed by a period.
>> The second expression finds the two consecutive tabs.
>>
>> Then in the Replace, we add a tab, whatever the first Find expression found,
>> and another tab. �We discard the result of the second find expression (the
>> two tabs).
>>
>> If your number series exceeds one digit, you need to double the [0-9] in the
>> first expression and run that first to do all the two-digit numbers, then
>> remove that and run again to do the single digit numbers. �If you try to do
>> the singles first and then the doubles, you'll break it :-)
>>
>> Hope this helps
>>

--

Mactopia is currently broken: the helpers are not seeing any of the
questions being posted.  Microsoft is working on the problem.  In the
meantime:

To successfully post in here, either use Google:

Or Microsoft Communities:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=micros
oft.public.mac.office.word&cat=en_US_3cf8ecf1-ca81-4391-b07d-8933029ee8a9&la
ng=en&cr=US

Or in Entourage, use the pre-configured Microsoft News server:
See "setting up Entourage for Newsreading" here:
http://word.mvps.org/Mac/AccessNewsgroups.html

matters unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:john@mcghie.name

```
 0

```On Nov 25, 12:10=A0am, John McGhie <j...@mcghie.name> wrote:
> The Replace should not have needed tweaking :-)
>
> The "\1" replaces "Whatever was found". =A0So check your "Find What" to e=
nsure
> that you have included the decimal point inside the parentheses, so that =
it
> becomes one of the "found" characters.
>
> Otherwise, this thing will fire on "any digit" and you don't want that :-=
)
>
> Cheers
>
> On 25/11/09 4:13 AM, in article
>
>
>
> "Fogharty" <fogha...@lycos.com> wrote:
> > What would I do without you John!
>
> > A couple of things I've discovered:
>
> > I can't just copy and paste the search terms from my browser to my
> > Find dialog in Word... it only works if I type it in by hand.
>
> > I had to tweak the Replace
> > =A0^t\1^t
> > With
> > ^t\1.^t
> > to keep the decimal point there.
>
> > But otherwise... goodness! This will save me =A0a load of time.
>
> > Now if I can get my other problem fixed, I'll be good to go!
>
> > Thanks!
>
> > On Nov 23, 7:30=A0pm, John McGhie <j...@mcghie.name> wrote:
> >> Yes, it can be done.
>
> >> Now, let's see if I can remember how... :-)
>
> >> Ah hah! =A0I knew I had this somewhere...
>
> >> Find What is:
>
> >> ([0-9].)(^t^t)
>
> >> Replace with is:
>
> >> ^t\1^t
>
> >> And "Use Wildcards" must be turned on.
>
> >> What this does is divide the find into two regular expressions, using =
( and
> >> ).
>
> >> The first expression finds any SINGLE digit 0 to 9 followed by a perio=
d.
> >> The second expression finds the two consecutive tabs.
>
> >> Then in the Replace, we add a tab, whatever the first Find expression =
found,
> >> and another tab. =A0We discard the result of the second find expressio=
n (the
> >> two tabs).
>
> >> If your number series exceeds one digit, you need to double the [0-9] =
in the
> >> first expression and run that first to do all the two-digit numbers, t=
hen
> >> remove that and run again to do the single digit numbers. =A0If you tr=
y to do
> >> the singles first and then the doubles, you'll break it :-)
>
> >> Hope this helps
>
> =A0--
>
> Mactopia is currently broken: the helpers are not seeing any of the
> questions being posted. =A0Microsoft is working on the problem. =A0In the
> meantime:
>
group/microsoft.public.mac.office.word?lnk=3D
>
> Or Microsoft Communities:http://www.microsoft.com/communities/newsgroups/=
en-us/default.aspx?dg...
> oft.public.mac.office.word&cat=3Den_US_3cf8ecf1-ca81-4391-b07d-8933029ee8=
a9&la
> ng=3Den&cr=3DUS
>
> Or in Entourage, use the pre-configured Microsoft News server:
> See "setting up Entourage for Newsreading" here:http://word.mvps.org/Mac/=
AccessNewsgroups.html
>
> matters unless you intend to pay!
>
> John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
> McGhie Information Engineering Pty Ltd
> Sydney, Australia. | Ph: +61 (0)4 1209 1410
> +61 4 1209 1410, mailto:j...@mcghie.name

Pasting into the Find-and-replace dialog:

I often have problems with this. I not infrequently get blocks of text
from web-pages etc, which comes in with inappropriate line-endings of
some sort which need removing.

If I paste that text into Word 5, I can select whatever is at the end
of the line, and paste it into the Replace box. Word 2008 won't let me
paste anything in. I sometimes can't tell what the particular line-
ending character actually IS, so I don't know what to actually type
into the dialog...

Any suggestions? (other than sticking to Word 5, which is what I would
like to do!)
```
 0

```Hi Dow:

I cannot understand what you mean?

Pasting into Word 2008's Find box works fine for me.  Wild cards are ASCII
symbols, so you can paste them readily.  You can't paste line-enders because
they are significant characters in the search: you have to use either ^l, ^m
or ^p, depending on which one you want.

Cheers

On 25/11/09 7:59 PM, in article
<dow.smith@gmail.com> wrote:

> Pasting into the Find-and-replace dialog:
>
> I often have problems with this. I not infrequently get blocks of text
> from web-pages etc, which comes in with inappropriate line-endings of
> some sort which need removing.
>
> If I paste that text into Word 5, I can select whatever is at the end
> of the line, and paste it into the Replace box. Word 2008 won't let me
> paste anything in. I sometimes can't tell what the particular line-
> ending character actually IS, so I don't know what to actually type
> into the dialog...
>
> Any suggestions? (other than sticking to Word 5, which is what I would
> like to do!)

--

matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:john@mcghie.name

```
 0

5 Replies
162 Views

Similiar Articles:

7/21/2012 1:43:37 AM