Truncate links using case insensitive regular expression