Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Nov 2006
    Posts
    97
    Thanks
    11
    Thanked 2 Times in 2 Posts

    Find and Replace: wildcard for whole word

    I have a Word 2010 document in which each line ends with "posted by [firstname] [lastname]", which I want to delete. What I need is a wildcard for a complete word, so that I can run a Find and Replace for "posted by wildcard wildcard" replaced with nothing.

    That is, if two lines end with "posted by John Smith" and "posted by Elizabeth Moore" I want to delete "posted by" and the two following strings, whatever they are.

    I know I could have a macro search for "posted" and use Shift End plus Delete. I'd rather have a whole-word wildcard, though.

    KRS

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,898
    Thanks
    0
    Thanked 188 Times in 172 Posts
    Using a wildcard Find/Replace:
    Find = posted by <*> <*>
    Replace = nothing
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. The Following User Says Thank You to macropod For This Useful Post:

    krsmav (2012-10-07)

  4. #3
    5 Star Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    1,199
    Thanks
    45
    Thanked 228 Times in 211 Posts
    Try in the Find what: (posted)> <*> <*> <*>
    Replace with: ""
    Translated, it is saying, find the word posted and the next 3 words following it. Note the spaces between the 4 expressions.

    HTH,
    Maud

  5. The Following User Says Thank You to Maudibe For This Useful Post:

    krsmav (2012-10-07)

  6. #4
    Star Lounger
    Join Date
    Nov 2006
    Posts
    97
    Thanks
    11
    Thanked 2 Times in 2 Posts
    Great! I went through a dozen wildcard lists but didn't find <*>.

  7. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,898
    Thanks
    0
    Thanked 188 Times in 172 Posts
    Quote Originally Posted by Maudibe View Post
    Try in the Find what: (posted)> <*> <*> <*>
    Replace with: ""
    Translated, it is saying, find the word posted and the next 3 words following it. Note the spaces between the 4 expressions.
    Hi Maud,

    The problem with your approach is that it would also delete "posted to x x", "posted on x x", etc. Also, having '(posted)> ' is superfluous - it achieved nothing more than 'posted '
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Tags for this Thread

Posting Permissions

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