      trim_url = lambda x, limit=trim_url_limit: limit is not None and (len(x) > limit and ('%s...' % x[:max(0, limit - 3)])) or x
      safe_input = isinstance(text, SafeData)
      words = word_split_re.split(force_text(text))
      for i, word in enumerate(words):
          match = None
          if '.' in word or '@' in word or ':' in word:
              # Deal with punctuation.
              lead, middle, trail = '', word, ''
              for punctuation in TRAILING_PUNCTUATION:
                  if middle.endswith(punctuation):
 
</s> remove simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$', re.IGNORECASE)
 </s> add simple_url_2_re = re.compile(r'^www\.|^(?!http)\w[^@\[\]]+\.(com|edu|gov|int|mil|net|org)$', re.IGNORECASE) </s> remove import re, string
 </s> add import re
      trim_url = lambda x, limit=trim_url_limit: limit is not None and (len(x) > limit and ('%s...' % x[:max(0, limit - 3)])) or x
      safe_input = isinstance(text, SafeData)
      words = word_split_re.split(force_text(text))
      for i, word in enumerate(words):

          if '.' in word or '@' in word or ':' in word:
              # Deal with punctuation.
              lead, middle, trail = '', word, ''
              for punctuation in TRAILING_PUNCTUATION:
                  if middle.endswith(punctuation):
keep keep keep keep replace keep keep keep keep keep
 update regex for matching URLs, fixes issue #1386 
rest_framework/templatetags/rest_framework.py