Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Search/Replace not reading correct expression # (Word 2007)

    I am doing a search and replace, something I thought I had mastered. However, I am stumped.

    - I have selected Use wildcards .

    - In the Find what box:

    (<span style="font-weight: bold;">)(*)(</span>)

    - In the Replace with box:

    2

    Expected result should be "(whatever the 2nd expression is)".

    The Find works correctly. However, I am getting an error that says "The Replace with text contains a group number which is out of range."

    If I change the text in the Replace with box to just "2", it works fine. Thus, it is something around the "2" that is messing things up. Can someone help me decipher this?

    Thanks!!
    Troy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Search/Replace not reading correct expression # (Word 2007)

    Try this in the 'Replace with' box:

    2

    (You don't need to use to escape special characters in the 'Replace with' box)

  3. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Search/Replace not reading correct expression # (Word 2007)

    When you have Use wildcards selected, you cannot use "<" or ">" because they represent a beginning of word or end of word expression.

    However, once I saw where the problem was (thanks to you), I did find a way around it by replacying the "<" with "^60".

    Thanks for the help!!
    Troy

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Search/Replace not reading correct expression # (Word 2007)

    > When you have Use wildcards selected, you cannot use "<" or ">" because they represent a beginning of word or end of word expression.

    For the 'Replace with' box, that must be new to Word 2007. I tested in Word 2002; the characters < and > have a special meaning in the 'Find what' box in that version, but not in the 'Replace with' box.
    Anyway, glad you've solved the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •