  
          https://github.com/alanjds/drf-nested-routers
          """
          base_regex = '(?P<{lookup_prefix}{lookup_field}>{lookup_value})'
          lookup_field = getattr(viewset, 'lookup_field', 'pk')
          lookup_value = getattr(viewset, 'lookup_value_regex', '[^/.]+')
          return base_regex.format(
              lookup_prefix=lookup_prefix,
              lookup_field=lookup_field,
 
</s> remove         try:
            lookup_value = viewset.lookup_value_regex
        except AttributeError:
            # Don't consume `.json` style suffixes
            lookup_value = '[^/.]+'
 </s> add         lookup_value = getattr(viewset, 'lookup_value_regex', '[^/.]+')
        # Use `pk` as default field, unset set.  Default regex should not
        # consume `.json` style suffixes and should break at '/' boundaries.
  
          https://github.com/alanjds/drf-nested-routers
          """
          base_regex = '(?P<{lookup_prefix}{lookup_field}>{lookup_value})'
        # Use `pk` as default field, unset set.  Default regex should not
        # consume `.json` style suffixes and should break at '/' boundaries.
          lookup_field = getattr(viewset, 'lookup_field', 'pk')
          lookup_value = getattr(viewset, 'lookup_value_regex', '[^/.]+')
          return base_regex.format(
              lookup_prefix=lookup_prefix,
              lookup_field=lookup_field,
keep keep keep add keep keep keep keep keep
 Minor tweaks to 'lookup_value_regex' work 
rest_framework/routers.py