method
json_regexp
v4.2.9 -
Show latest stable
- Class:
ActionDispatch::Routing::RouteWrapper
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