method
initialize_regexp

v1_9_2_180 -
Show latest stable
-
0 notes -
Class: Parser
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125 (38)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
initialize_regexp(pattern)
private
Hide source
# File lib/uri/common.rb, line 396 def initialize_regexp(pattern) ret = {} # for URI::split ret[:ABS_URI] = Regexp.new('\A\s*' + pattern[:X_ABS_URI] + '\s*\z', Regexp::EXTENDED) ret[:REL_URI] = Regexp.new('\A\s*' + pattern[:X_REL_URI] + '\s*\z', Regexp::EXTENDED) # for URI::extract ret[:URI_REF] = Regexp.new(pattern[:URI_REF]) ret[:ABS_URI_REF] = Regexp.new(pattern[:X_ABS_URI], Regexp::EXTENDED) ret[:REL_URI_REF] = Regexp.new(pattern[:X_REL_URI], Regexp::EXTENDED) # for URI::escape/unescape ret[:ESCAPED] = Regexp.new(pattern[:ESCAPED]) ret[:UNSAFE] = Regexp.new("[^#{pattern[:UNRESERVED]}#{pattern[:RESERVED]}]") # for Generic#initialize ret[:SCHEME] = Regexp.new("^#{pattern[:SCHEME]}$") ret[:USERINFO] = Regexp.new("^#{pattern[:USERINFO]}$") ret[:HOST] = Regexp.new("^#{pattern[:HOST]}$") ret[:PORT] = Regexp.new("^#{pattern[:PORT]}$") ret[:OPAQUE] = Regexp.new("^#{pattern[:OPAQUE_PART]}$") ret[:REGISTRY] = Regexp.new("^#{pattern[:REG_NAME]}$") ret[:ABS_PATH] = Regexp.new("^#{pattern[:ABS_PATH]}$") ret[:REL_PATH] = Regexp.new("^#{pattern[:REL_PATH]}$") ret[:QUERY] = Regexp.new("^#{pattern[:QUERY]}$") ret[:FRAGMENT] = Regexp.new("^#{pattern[:FRAGMENT]}$") ret end