locked
Wildcard search for words ending in '-ing' and not preceded by commas RRS feed

  • Question

  • Hi regex gurus,

     

    I need help to construct a search pattern in MS Word 2010, using wildcards.

     

    I need to find all occurences of words which end in -ing and are not preceded by commas - e.g.

     

    The brown fox stood looking at the hunter. - this is a match

    The brown fox stood, looking at the hunter. - this is NOT a match

     

    I was thinking of something like this: [!,] <[A-Za-z]@ing>

     

    but it finds ""d looking", rather than just "looking".

     

    Can someone jusest me a more elegant solution?

    Monday, October 24, 2011 11:47 AM

Answers

  • What do you want to do with the found text?  I have searches for "including", "which", and a few other words not preceded by a comma. But since I want to add the comma, my find string is, for example,

    ([!,])( including)

    and the replace string is

    \1,\2

    I use these F&Rs with the Editorium's MegaReplacer add-on, which allows me to approve each change (or to run my fairly long list of changes blind).

    If you have a different purpose and just want to select the -ing words not preceded by a comma, a macro may be your solution.

    Pam

    Tuesday, October 25, 2011 3:52 AM