fix regular expressions to replace links