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?

#53864
Casey
Participant

Jongware said:

If you end all with (?=.?), it won't pick up a sentence ending period after the URL. With your expression such a period is used as part of the URLs. And I'm surprised the dash works in your expressions (or .. does it?). I think that in ”[w%-/]” it'll match anything from '%' to '/' — adding, for example, the plus sign and the comma. Well, perhaps you wanted it to.

(My personal variant is way, way longer — but it includes php's characters ?, =, & and then some more!)


I've had some variations over time, but this one seems to take in account all the scenarios I've run into so far. And yes, they have been much longer as well. You bring up an interesting point regarding the dash as it would normally denote a range within a character set. I should probably move it to the beginning. And it's also true that I could add that positive lookahead as well, good idea.

This article was last modified on November 20, 2009

Comments (0)

Loading comments...