Skip to main content
Spenno
Inspiring
January 20, 2017
Answered

Underline word using Find and Replace?

  • January 20, 2017
  • 2 replies
  • 1509 views

Hi all. I have some documents all in the same paragraph style, where websites are frequently mentioned. These websites are not in specific character styles nor are they hyperlinks, which would have been handy. My question - how can I underline the entire website name using find and replace? I have created an underlining character style, but am not sure what variable to write after 'www.' in the search field to signify that I would like to underline everything from the www. through to the end of that word. I can't even ask it to underline to the next '.' as that character is often used in the web address. Ideally, it should underline everything up to the next space character, excluding any final punctuating character - ie www.webaddress.goeshere.co.uk. Next sentence...

Sorry if that was a really long-winded way of explaining something simple. Previously these addresses have already been hyperlinks when I've imported them.

    This topic has been closed for replies.
    Correct answer Barb Binder

    Take a look at this thread:

    http://indesignsecrets.com/topic/shortest-grep-pattern-to-address-urls-and-e-mail-addresses-37

    You can use GREP to Find/Change as you asked, and as SJRiegel showed you, but here's my tip: once you know the Find works, it would be easier in the long run to use GREP style. That way, if you add a URL after you have run the F/C, InDesign will automatically format it for you.

    2 replies

    Barb Binder
    Community Expert
    Barb BinderCommunity ExpertCorrect answer
    Community Expert
    January 20, 2017

    Take a look at this thread:

    http://indesignsecrets.com/topic/shortest-grep-pattern-to-address-urls-and-e-mail-addresses-37

    You can use GREP to Find/Change as you asked, and as SJRiegel showed you, but here's my tip: once you know the Find works, it would be easier in the long run to use GREP style. That way, if you add a URL after you have run the F/C, InDesign will automatically format it for you.

    ~Barb at Rocky Mountain Training
    Legend
    January 20, 2017

    Find

    www.*?(?=[[:punct:]]??\s)

    Change to

    $0

    This worked for all the instances of punctuation listed here, but not if there is no space