Wildcard Search Replace

S

SGC

I need to take each instance of
^pTEXTLEADER varyingtext </P>^p<P>
and replace it with
^pTEXTLEADER varyingtext ^p
I can't simply find and replace
</P>^p<P>
with
^p
because
</P>^p<P>
occurs in many places in my file and I want to keep it in those other
places; I already tried this and it returns too many errors on my final
file.

I've looked at "LCase", "Left", "LTrim", "Trim", "Mid", "RCase", "Right",
and "RTrim"; none of these does what I need to do.

Help is greatly appreciated!!
SGC
 
K

Klaus Linke

Hi SGC,

You probably know already that you need to use ^13 instead of ^p in wildcard
searches.

For the "varyingtext", you should use [!^13]@, so you don't match several
paragraphs.
This will match any text, as long as it doesn't contain paragraph marks.

The "<" and ">" have to be escaped ("\<", "\>), since they are wildcard
characters for word anchors.

So you'd get:
Find what: (^13TEXTLEADER[!^13]@)\</P\>^13\<P\>
Replace with: \1^p

Greetings,
Klaus
 
H

Helmut Weber

Hi,
is "^p" a paragraph mark?
Like ¶ ?
What does "</P>" stand for? and <P>?
Are you talking about a word document
or plain text or a string variable?
Greetings from Bavaria, Germany
Helmut Weber
"red.sys" & chr$(64) & "t-online.de"
Word XP, NT 4.0
 

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