Superscript formatting in Find/Replace

G

Guest

I need to find a way to format text that contains both superscript and normal
characters. I am trying to find a way to do a find/replace command that
accomplishes the following:

[superscript numbers]. to .[superscript numbers]

The numbers in question are reference citations, so I can't just type in the
actual numbers; I need something that will grab all superscript numbers and
treat them as a single unit that I can move the period around. Doesn't seem
like it would be this difficult, but I can't find a way to do it. Thanks!
 
J

Jay Freedman

I need to find a way to format text that contains both superscript and normal
characters. I am trying to find a way to do a find/replace command that
accomplishes the following:

[superscript numbers]. to .[superscript numbers]

The numbers in question are reference citations, so I can't just type in the
actual numbers; I need something that will grab all superscript numbers and
treat them as a single unit that I can move the period around. Doesn't seem
like it would be this difficult, but I can't find a way to do it. Thanks!

If these superscript numbers are the only numbers in the document that
are immediately followed by a period, then you can do it with a
wildcard replacement
(http://www.gmayor.com/replace_using_wildcards.htm).

In the Replace dialog, click the More button and check the box for
"Use wildcards". Then enter this expression in the Find What box:

([0-9]{1,})(.)

and enter this one in the Replace With box:

\2\1

Then click the Replace All button.

The possible problem is that there's no way (except with a somewhat
complicated macro) to make the replacement work only on superscript
numbers, because the search box has no way to specify formatting for
only part of the expression. If there are non-superscript numbers
followed by a period -- for example, a date at the end of a sentence
-- you could manually click the Replace and Find Next buttons to guide
the replacement, or you can post back for help with the macro.
 
G

Graham Mayor

It might help to note that you can replace with formatted strings that are
first copied to the clipboard. This might give you more flexibility by
replacing your search string with ^c

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Jay said:
I need to find a way to format text that contains both superscript
and normal characters. I am trying to find a way to do a
find/replace command that accomplishes the following:

[superscript numbers]. to .[superscript numbers]

The numbers in question are reference citations, so I can't just
type in the actual numbers; I need something that will grab all
superscript numbers and treat them as a single unit that I can move
the period around. Doesn't seem like it would be this difficult, but
I can't find a way to do it. Thanks!

If these superscript numbers are the only numbers in the document that
are immediately followed by a period, then you can do it with a
wildcard replacement
(http://www.gmayor.com/replace_using_wildcards.htm).

In the Replace dialog, click the More button and check the box for
"Use wildcards". Then enter this expression in the Find What box:

([0-9]{1,})(.)

and enter this one in the Replace With box:

\2\1

Then click the Replace All button.

The possible problem is that there's no way (except with a somewhat
complicated macro) to make the replacement work only on superscript
numbers, because the search box has no way to specify formatting for
only part of the expression. If there are non-superscript numbers
followed by a period -- for example, a date at the end of a sentence
-- you could manually click the Replace and Find Next buttons to guide
the replacement, or you can post back for help with the macro.
 
J

Jay Freedman

Replacement with a formatted string in the clipboard is fine, but you
can't _search_ for a string with mixed formatting except with a macro
that examines the found range.

It might help to note that you can replace with formatted strings that are
first copied to the clipboard. This might give you more flexibility by
replacing your search string with ^c

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Jay said:
I need to find a way to format text that contains both superscript
and normal characters. I am trying to find a way to do a
find/replace command that accomplishes the following:

[superscript numbers]. to .[superscript numbers]

The numbers in question are reference citations, so I can't just
type in the actual numbers; I need something that will grab all
superscript numbers and treat them as a single unit that I can move
the period around. Doesn't seem like it would be this difficult, but
I can't find a way to do it. Thanks!

If these superscript numbers are the only numbers in the document that
are immediately followed by a period, then you can do it with a
wildcard replacement
(http://www.gmayor.com/replace_using_wildcards.htm).

In the Replace dialog, click the More button and check the box for
"Use wildcards". Then enter this expression in the Find What box:

([0-9]{1,})(.)

and enter this one in the Replace With box:

\2\1

Then click the Replace All button.

The possible problem is that there's no way (except with a somewhat
complicated macro) to make the replacement work only on superscript
numbers, because the search box has no way to specify formatting for
only part of the expression. If there are non-superscript numbers
followed by a period -- for example, a date at the end of a sentence
-- you could manually click the Replace and Find Next buttons to guide
the replacement, or you can post back for help with the macro.
 
G

Graham Mayor

True - but depending on what is being sought, it may be possible to find the
search string regardless of its formatting. This is essentially what you
suggested with ([0-9]{1,})(.) which I suspect would have filled the bill for
the OP.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Jay said:
Replacement with a formatted string in the clipboard is fine, but you
can't _search_ for a string with mixed formatting except with a macro
that examines the found range.

It might help to note that you can replace with formatted strings
that are first copied to the clipboard. This might give you more
flexibility by replacing your search string with ^c

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Jay said:
On Thu, 8 Nov 2007 07:37:04 -0800, GMatiasevich

I need to find a way to format text that contains both superscript
and normal characters. I am trying to find a way to do a
find/replace command that accomplishes the following:

[superscript numbers]. to .[superscript numbers]

The numbers in question are reference citations, so I can't just
type in the actual numbers; I need something that will grab all
superscript numbers and treat them as a single unit that I can move
the period around. Doesn't seem like it would be this difficult,
but I can't find a way to do it. Thanks!

If these superscript numbers are the only numbers in the document
that are immediately followed by a period, then you can do it with a
wildcard replacement
(http://www.gmayor.com/replace_using_wildcards.htm).

In the Replace dialog, click the More button and check the box for
"Use wildcards". Then enter this expression in the Find What box:

([0-9]{1,})(.)

and enter this one in the Replace With box:

\2\1

Then click the Replace All button.

The possible problem is that there's no way (except with a somewhat
complicated macro) to make the replacement work only on superscript
numbers, because the search box has no way to specify formatting for
only part of the expression. If there are non-superscript numbers
followed by a period -- for example, a date at the end of a sentence
-- you could manually click the Replace and Find Next buttons to
guide the replacement, or you can post back for help with the macro.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top