Module: Bio::GFF::GFF2::Escape

Included in:
Record, Record::Value
Defined in:
lib/bio/db/gff.rb

Overview

Private methods for GFF2 escaping characters. Internal only. Users should not use this module directly.

Constant Summary collapse

UNSAFE_GFF2 =

unsafe characters to be escaped

/[^-_.!~*'()a-zA-Z\d\/?:@+$\[\] \x80-\xfd><;=,%^&\|`]/n
IDENTIFIER_GFF2 =

GFF2 standard identifier

/\A[A-Za-z][A-Za-z0-9_]*\z/n
NUMERIC_GFF2 =

GFF2 numeric value

/\A[-+]?([0-9]+|[0-9]*\.[0-9]*)([eE][+-]?[0-9]+)?\z/n
BACKSLASH =

List of 1-letter special backslash code. The letters other than listed here are the same as those of without backslash, except for “x” and digits. (Note that u (unicode) is not supported.)

{
  't'  => "\t",
  'n'  => "\n",
  'r'  => "\r",
  'f'  => "\f",
  'b'  => "\b",
  'a'  => "\a",
  'e'  => "\e",
  'v'  => "\v",
  # 's'  => " ",
}.freeze
CHAR2BACKSLASH =

inverted hash of BACKSLASH

BACKSLASH.invert.freeze
CHAR2BACKSLASH_EXTENDED =

inverted hash of BACKSLASH, including double quote and backslash

CHAR2BACKSLASH.merge({ '"' => '"', "\\" => "\\" }).freeze
PROHIBITED_GFF2_COLUMNS =

prohibited characters in GFF2 columns

/[\t\r\n\x00-\x1f\x7f\xfe\xff]/
PROHIBITED_GFF2_TAGS =

prohibited characters in GFF2 attribute tags

/[\s\"\;\t\r\n\x00-\x1f\x7f\xfe\xff]/