Linking non-linked URLs
Posted: Tue Jun 15, 2010 5:30 pm
In my forum, I'd like to automatically link any URLs in the posts that are not already linked. I have this regex I found...
But I can't figure out how to make it ignore cases where there are quotes at the end. I have tried putting [^"\'] at various places within the regex, but that doesn't work. I also tried putting [\s\r\n], hoping it would find a blank space or new line and count that as a non-linked url, but that didn't work either. Any help would be much appreciated!
Code: Select all
@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.\-]*(\-\?\S+)?)?)?)@