The best way to do this is to use a negative lookbehind (in languages that support them):
/(?>http:\/\/[^\s]*)(?<!\.dtd)/g
?> , regex - URL-, , / , .
(<!\.dtd) - lookbehind, \.dtd (.. URL- .dtd).
, (, JavaScript), lookahead, :
/(http:\/\/(?![^\s]*\.dtd\b)[^\s]*)/g
http://, , , .dtd, , .
, http://www.regular-expressions.info/