method
json_regexp
Ruby on Rails latest stable (v7.1.3.2)
-
0 notes -
Class: RouteWrapper
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