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- COOKIE_OCTET =
!! RFC 6265 IS PROPOSED AND NOT AN IMPLEMENTED STANDARD YET !! Matches the RFC6265 definition of a cookie-octet COOKIE_VALUE = /(?:#QUOTED|#COOKIE_OCTET)/o COOKIE_NAME = TOKEN Matches the RFC6265 definition of cookie-pair. Captures name (1) and value (2). !! RFC 6265 IS PROPOSED AND NOT AN IMPLEMENTED STANDARD YET !!
/[\x21-\x7E&&[^",;\\]]*/- COOKIE_NAME =
/[^;,=\s]*/- COOKIE_VALUE =
/[^;,\s]*/- COOKIE_PAIR =
/\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- COOKIE_PARAM =
Specifically matches cookie parameters
/\A(#{TOKEN})=?(#{QUOTED}|#{COOKIE_OCTET})\z/o