Wild Card Search Question

J

Joe McGuire

I am using wildcards to Find and Replace paragraphs beginning with a single
alpha character and followed by a period and a tab. The string
([a-z]{1}.^t*^13) finds them all. But I can't figure out how to phrase the
string to do the same for paragraphs beginning with lower case Roman
numerals (i, ii, iii) which are otherwise identical to the alpha paragraphs.
As far as I can tell, the only Roman characters in the document are i, ii
and iii, but there are lots of them. I'd appreciate any suggestions. (No,
I did not create the document this way.)
 
J

Jay Freedman

Joe said:
I am using wildcards to Find and Replace paragraphs beginning with a
single alpha character and followed by a period and a tab. The string
([a-z]{1}.^t*^13) finds them all. But I can't figure out how to
phrase the string to do the same for paragraphs beginning with lower
case Roman numerals (i, ii, iii) which are otherwise identical to the
alpha paragraphs. As far as I can tell, the only Roman characters in
the document are i, ii and iii, but there are lots of them. I'd
appreciate any suggestions. (No, I did not create the document this
way.)

You can try this expression:

[!i]({1,3}.^t*^13)

If you're doing any replacement or reformatting, apply it only to the
expression \1 that corresponds to the part inside the parentheses -- the
[!i] means "any character except i" and will match the character preceding
what you want, probably a paragraph mark.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Joe McGuire

Thanks, Jay. Your suggestioin did not run. But it occured to me to run the
string looking for 2-3 instances of the roman numeral and it worked fine.
Than I ran it for single instances and decided one-by-one whether to make
the desired change.

Jay Freedman said:
Joe said:
I am using wildcards to Find and Replace paragraphs beginning with a
single alpha character and followed by a period and a tab. The string
([a-z]{1}.^t*^13) finds them all. But I can't figure out how to
phrase the string to do the same for paragraphs beginning with lower
case Roman numerals (i, ii, iii) which are otherwise identical to the
alpha paragraphs. As far as I can tell, the only Roman characters in
the document are i, ii and iii, but there are lots of them. I'd
appreciate any suggestions. (No, I did not create the document this
way.)

You can try this expression:

[!i]({1,3}.^t*^13)

If you're doing any replacement or reformatting, apply it only to the
expression \1 that corresponds to the part inside the parentheses -- the
[!i] means "any character except i" and will match the character preceding
what you want, probably a paragraph mark.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.
 

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