8 Replies Latest reply on Dec 7, 2015 8:28 AM by pmwibif

    Grep for websites without www prefix


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

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


      That works great except for the occasional glitch, like I've attached. I assume the "4" in the code has something to do with the fact that if the word has 4 characters before "com" it will change apply the grep style (notice the words outcome and overcome. Any suggestions to perfect this code?


      Thank you for your time.

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