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
/[\x21-\x7E&&[^",;\\]]*/.freeze
/(?:#{QUOTED}|#{COOKIE_OCTET})/o.freeze
TOKEN
/\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
/\A(#{TOKEN})=?(#{QUOTED}|#{COOKIE_OCTET})\Z/o.freeze