  
              ret.append(new_pattern)
          else:
              # Regular URL pattern
              regex = get_regex_pattern(urlpattern).rstrip('$').rstrip('/') + suffix_pattern
              view = urlpattern.callback
              kwargs = urlpattern.default_args
              name = urlpattern.name
              # Add in both the existing and the new urlpattern
              if not suffix_required:
 
</s> remove             regex = get_regex_pattern(urlpattern)
 </s> add             regex = urlpattern.pattern.regex.pattern </s> remove             if is_route_pattern(urlpattern):
 </s> add             if isinstance(urlpattern.pattern, RoutePattern): </s> remove             if is_route_pattern(urlpattern):
 </s> add             if isinstance(urlpattern.pattern, RoutePattern): </s> remove             path_regex = prefix + get_original_route(pattern)
 </s> add             path_regex = prefix + str(pattern.pattern) </s> remove         pairs = [(inspector.get_path_from_regex(get_regex_pattern(pattern)), pattern.callback)
 </s> add         pairs = [(inspector.get_path_from_regex(pattern.pattern.regex.pattern), pattern.callback)
            regex = urlpattern.pattern.regex.pattern.rstrip('$').rstrip('/') + suffix_pattern
  
              ret.append(new_pattern)
          else:
              # Regular URL pattern
            regex = urlpattern.pattern.regex.pattern.rstrip('$').rstrip('/') + suffix_pattern
              view = urlpattern.callback
              kwargs = urlpattern.default_args
              name = urlpattern.name
              # Add in both the existing and the new urlpattern
              if not suffix_required:
keep keep keep keep replace keep keep keep keep keep
 Drop all compat support to Django < 2 urls (#7337) 
rest_framework/urlpatterns.py