Reply To: I can’t figure this GREP search out

Home Page / Forums / General InDesign Topics (CLOSED) / I can’t figure this GREP search out / Reply To: I can’t figure this GREP search out

#53215

First off, your GREP is even less readable than they normally are, because this forum's text editor eats single backslashes. To see one //, you need to insert two. To see two ////s, you need to insert four.

If I mentally fill in backslashes at like places, it looks like it grabs an http, ftp, or www prefix, then anything non-whitespace, followed by a period and between two and four lowercase chars — presumably, to catch postfixes in the shortest form (www.adobe.com) up to common file extensions in the longest form (www.yadayada.com/yadaydaya.html). (I wonder where the parenthesized stuff and the OR bar came from — they don't appear to add anything useful …)

Appending a slash after this makes no sense, as it will never (well — rarely) match a subfolder after the initial web site name (www.adobe.com/indesign <– this will NOT match the pattern).

As I see it, all you need to do is remove the period-plus-extension stuff at the end. You don't even have to add the slash, it will be picked up by the not-a-space sequence. It will have other repercussions, in it that you'll also pick up much more unwanted stuff as well. Then again, the original expression wasn't bullet proof either — but neither is any URL catching GREP I've seen so far.

This article was last modified on June 24, 2010

Comments (0)

Loading comments...