Re: Effective use of the ^& find/replace wildcard

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Klaus Linke (info_at_fotosatz-kaufmann.de.no.junk)
Date: 04/22/04


Date: Fri, 23 Apr 2004 00:57:43 +0200

Hi W,

^& re-inserts the whole matched text.
Put (brackets) around parts you want to re-use.

In your case:
Find what: ^13([!^t])
Replace with: ^32\1

I used ^32 for the space, so it's clearly visible in this post. You could
as well type a space.
The \1 inserts the stuff from the first (and in this case only) bracket.
The paragraph mark ^13 gets deleted.

The help and/or http://word.mvps.org/FAQs/General/UsingWildcards.htm has
more info.

Greetings,
Klaus

"WBM" <miller.2555@osu.edu> wrote:
> I'm attempting to find certain text in Word documents
> using the Find/ Replce utility with wildcards and replace
> each matching text with a variant of the found text. For
> example, to assemble multi-line paragraphs into a
> paragraph that does not contain any line-breaks one can
> ues a find expression "^13[!^t]" (w/o quotes) to find any
> carriage returns not proceeded by a line indented by a tab
> and replace them with a space character. However, the
> first letter of each original line will be replaced by the
> space since it appears in the regular expression. Any
> suggestions as to how to retain the last character in the
> replaced text (a general case for preserving the first or
> middle charater would be better)? It seems an expression
> in the "replace with" textbox using the "^&" wildcard is
> warranted, but I have not yet been able effectively
> manipulate its use. Thank you in advance.



Relevant Pages

  • Re: Find spaces with Regex
    ... working fine, except in the example "1 space", it is picking up the space. ... I know it's because it's looking for a space, &, n, b, s, p,; character. ... How to I change the regular expression to look for a space ... without a quantifier like the * I added would only match a single one of the characters in the brackets. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: need help on regular expression pattern
    ... You need to spell out your rules more clearly. ... The most important step to writing a good regular expression is to clearly ... can have brackets. ... of the character class. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Primeval finale
    ... The paragraph ended with a full stop before the ... brackets began clearly indicated that they should not be considered ... In fact 3 episodes will not do it justice. ... you dance your silly little troll dance in reply on everything I type. ...
    (rec.arts.drwho)
  • Re: Simple Python REGEX Question
    ... How do you do this with python regular expression? ... If you know your string is a bracketed expression, ... But if you don't care about nested brackets, ...
    (comp.lang.python)
  • Re: rand()
    ... It's an intrinsic 'feature' so if you've got a proper installation it should ... It has to be the first and only text in a new paragraph. ... > numbers inside the brackets. ... > by reinstalling Word 2000, ...
    (microsoft.public.word.docmanagement)