method

json_regexp

rails latest stable - Class: ActionDispatch::Routing::RouteWrapper

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.2.9) is shown here.

json_regexp()
public

No documentation available.

# File actionpack/lib/action_dispatch/routing/inspector.rb, line 35
      def json_regexp
        str = regexp.inspect.
              sub('\A' , '^').
              sub('\Z' , '$').
              sub('\z' , '$').
              sub(/^\// , '').
              sub(/\/[a-z]*$/ , '').
              gsub(/\(\?#.+\)/ , '').
              gsub(/\(\?-\w+:/ , '(').
              gsub(/\s/ , '')
        Regexp.new(str).source
      end