Module: Landline::Util::HeaderRegexp

Defined in:
lib/landline/util/parseutils.rb

Overview

(not exactly precise) Regular expressions for some RFC definitions

Constant Summary collapse

TOKEN =

Matches the RFC2616 definiton of token

/[!-~&&[^()<>@,;:\\"\/\[\]?={}\t]]+/
QUOTED =

Matches the RFC2616 definition of quoted-string

/"[\x0-\x7E&&[^\x1-\x8\xb-\x1f]]*(?<!\\)"/
PRINTCHAR =

Matches any CHAR except CTLs

/[\x2-\x7E]/
PRINTABLE =

Matches 1 or more CHARs excluding CTLs

/#{PRINTCHAR}+/o
/[\x21-\x7E&&[^",;\\]]*/
/[^;,=\s]*/
/[^;,\s]*/
/\A(#{COOKIE_NAME})=(#{COOKIE_VALUE})\z/o
PARAM_QUOTED =

Matches a very abstract definition of a quoted header paramter. Captures name (1) and value (2).

/\A(#{TOKEN})=?(#{QUOTED}|#{PRINTCHAR}*)\z/o
PARAM =

Matches a very abstract definition of a header parameter. Captures name (1) and value (2).

/\A(#{TOKEN})=?(#{PRINTCHAR}*)\z/o
/\A(#{TOKEN})=?(#{QUOTED}|#{COOKIE_OCTET})\z/o