Grep for websites without the www prefix

I found a clever grep code for Web sites on this forum: ------< (https | http | ftp | www) [-~! #-; =? - Z_a - z] {4} (? <! ~ j)


However, our style requires no prefixes on websites, so I, not knowing much about grep, rearranged the code a little to this:------< [-~! #-; =? - Z_a - z] {4} (? <! ~ j)(com|org|gov|net)

That works great except for the occasional glitch, as I joined him. I guess that the '4' in the code has something to do with the fact that if the word has 4 characters before the 'com', it will change the grep style (note the result of words and overcome.) Any suggestions to improve this code?

Thank you for your time.

Screen Shot 2015-12-03 at 1.58.52 PM.png

I use in the searchfield:

(?! ([[: punct:] $]) [\S] {2,}\. [\S] {2} (?

I use it in the searchfield is because she's still a few false positives and I want to see what it's finding before I have apply different character style. I look for at least two characters, not three, because there are some URLS out there with only two characters as .uk. suffix

It is not perfect, but it's the best I could figure it out for now.

I hope this helps, and I'm completely open to suggestions on how to improve the script.

Tags: InDesign

Similar Questions

Maybe you are looking for