Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

GREP To Distinguish URL and Email Address

Return to Member Forum

  • Author
    Posts
    • #82580

      Hello All,

      I am working on some templates in InDesign and I need a GREP expression that will bold urls that do not use “www.” without bolding emails, money using decimals, P.O., U.S., etc.

      Below is an expression that I found online that gets me close but it’s still picking up the email address (except for the @ symbol). I was thinking I might be able to use that @ symbol to distinguish the url from the email but I’m not sure how.

      Also, I’m concerned that if the URL ends in a “/” that would not be bolded because of the use of [[:punct:]]

      This is the GREP expression I found:
      (?![[:punct:]])[\S]{2,}\.[\S]{2,}(?<![[:punct:]])

      I need these items to be bold:
      testurl.com
      testurl.com/abcd/

      I need these items to not be bold:
      Punctuation following urls (excluding “/” that could be part of the URL)
      joe.smith@testurl.com
      26.00
      P.O. Box
      U.S.

      Any ideas on how to make this work?

    • #82608
      Masood Ahmad
      Participant
Viewing 1 reply thread
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads