Exceptions in GREP search

Learn / Forums / General InDesign Topics / Exceptions in GREP search

Tagged: 

Viewing 11 reply threads
  • Author
    Posts
    • #70707
      Keith Barker
      Member

      Is it possible to formulate a GREP search to look for all instances of a word except where it appears in a web address or email address?

      For example, search for all examples of Adobe but not those in http://www.adobesystems.com or [email protected]

      Many thanks,

      Keith

    • #70708
      David Blatner
      Keymaster

      Would you want to find “adoberama” or “badobe” ?
      Or are you just looking for Adobe as a word? If so, put a word boundary code before and after it (you can find the word boundary code in the @ fly-out menu to the right of the grep field)

    • #70709
      Keith Barker
      Member

      Hi David,

      I would need to find Adobe, but also Adobe’s and Adobes.

    • #70711
      David Blatner
      Keymaster

      You could use: \b[aA]dobe'?s?\b
      (that would also find upper or lower case A)

    • #70712
      Keith Barker
      Member

      That works, but still selects the adobe in [email protected]

    • #70713
      David Blatner
      Keymaster

      Drat. Good point. How about \b(?
      (Added a negative lookbehind to say "make sure there's no at sign there")

    • #70714
      David Blatner
      Keymaster

      BTW, I see an extra space before the exclamation point… don’t include that. Not sure why our forum software stuck that in there.

    • #70716
      Keith Barker
      Member

      Without the space it’s still selecting the adobe in http://www.adobe.com.

      I’m about to leave the office now, so I’ll catch up with this later. Thanks for your help!

    • #70718
      David Blatner
      Keymaster

      Well, we’re seeing the evolution and debugging of a grep expression in real time here. ;-)

      How about: \b(?

    • #70732
      Keith Barker
      Member

      Thanks David for your help. I’ve got my search working. :)

    • #110765
      Jan L
      Member

      Hi David,

      I was trying to learn from this example, to resolve my challenge.
      What I am looking for is as follows:

      I would like select all instances of the word: King

      But not when it appears as part of longer name, such as: Thomas King — in these occasions it can stay as is.

      Would you have a tip for me?

      Thank you,

      Jan

    • #14323498

      Thank you, this was a very helpful post

Viewing 11 reply threads
  • You must be logged in to reply to this topic.

@2022 CreativePro Network. All Rights Reserved.
Design by: Lotus Child | Site by: Larry Jacob Internet Marketing

>