Try a negative lookbehind: (?!<["']). But a more reliable approach would be to parse the HTML and then process the text nodes only. After all, there might be all sorts of reasons why a URL is preceded by a quotation mark.
–
Felix KlingFeb 20 '13 at 15:30

3

This is a great example of why you should not use regular expressions to parse HTML. If you want to only search text and not tags for URLs, then you use a proper HTML parser to give you only the text and ignore the tags. See htmlparsing.com/php.html for examples of how to properly parse HTML with PHP modules.
–
Andy LesterFeb 20 '13 at 15:35

I have text as a string. That text may contains http://some.domen.com part of text without < a > tag, because user typed it like that. My task is to search for those link-links parts of text and convert them to real hyperlinks (just adding < a > tag ). So, I cannot use DOM to locate them. Am I right?
–
BranislavFeb 20 '13 at 17:37