method
json_regexp
json_regexp()
public
Hide source
# 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