Module: Hyde::Util::HeaderRegexp
- Defined in:
- lib/hyde/util/parseutils.rb
Overview
(not exactly precise) Regular expressions for some RFC definitions
Constant Summary collapse
- TOKEN =
Matches the RFC2616 definiton of token
/[!-~&&[^()<>@,;:\\"\/\[\]?={}\t]]+/.freeze
- QUOTED =
Matches the RFC2616 definition of quoted-string
/"[\x0-\x7E&&[^\x1-\x8\xb-\x1f]]*(?<!\\)"/.freeze
- PRINTCHAR =
Matches any CHAR except CTLs
/[\x2-\x7E]/.freeze
- PRINTABLE =
Matches 1 or more CHARs excluding CTLs
/#{PRINTCHAR}+/o.freeze
- COOKIE_OCTET =
Matches the RFC6265 definition of a cookie-octet
/[\x21-\x7E&&[^",;\\]]*/.freeze
- COOKIE_VALUE =
/(?:#{QUOTED}|#{COOKIE_OCTET})/o.freeze
- COOKIE_NAME =
TOKEN
- COOKIE_PAIR =
Matches the RFC6265 definition of cookie-pair. Captures name (1) and value (2).
/\A(#{COOKIE_NAME})=(#{COOKIE_VALUE})\Z/o.freeze
- PARAM_QUOTED =
Matches a very abstract definition of a quoted header paramter. Captures name (1) and value (2).
/\A(#{TOKEN})=?(#{QUOTED}|#{PRINTCHAR}*)\Z/o.freeze
- PARAM =
Matches a very abstract definition of a header parameter. Captures name (1) and value (2).
/\A(#{TOKEN})=?(#{PRINTCHAR}*)\Z/o.freeze
- COOKIE_PARAM =
Specifically matches cookie parameters
/\A(#{TOKEN})=?(#{QUOTED}|#{COOKIE_OCTET})\Z/o.freeze