Reply To: Shortest GREP Pattern to address URLs and e-mail addresses?

Home Page / Forums / General InDesign Topics (CLOSED) / Shortest GREP Pattern to address URLs and e-mail addresses? / Reply To: Shortest GREP Pattern to address URLs and e-mail addresses?

#53889

The only solution I see is making it longer — replace every w with [uld_] to catch only alphanumerics and underscore, add /? after the final break to include an optional final slash, and add (?=.?) as the very last part to find, but exclude, an optional period.

I see an additional problem: the designcenter/…/workshop URL contains an ellipsis, which you definitely not want to include (as it doesn't mean anything in URLs). You should have left this as three periods in the original text. (And it seems you might have had five consecutive periods :-D )

Why is it so important to find a shortest possible match? An URL just has a very complex syntax. To catch them all with a single expression, well, you just have to keep adding to a working expression up to the point where you are getting more false positives than you want. It is not as if you have to keep entering it manually into InDesign — that's what Save GREP Query is for.

This article was last modified on November 22, 2009

Comments (0)

Loading comments...