YAML Test Suite Test Cases | Schema examples | Schema comparison
This is a comparison of the different YAML Schemas and how the Perl module YAML::PP implements them.

YAML 1.2 Failsafe Schema

Regular expressionResolved to tag
/* Empty */tag:yaml.org,2002:str
.*tag:yaml.org,2002:str (Default)

YAML 1.2 JSON Schema

Regular expressionResolved to tag
true | falsetag:yaml.org,2002:bool
-? ( 0 | [1-9] [0-9]* )tag:yaml.org,2002:int
-? ( 0 | [1-9] [0-9]* ) ( \. [0-9]* )? ( [eE] [-+]? [0-9]+ )?tag:yaml.org,2002:float
nulltag:yaml.org,2002:null
Official
/* Empty */Error
.*Error
YAML::PP (option empty=str (default))
/* Empty */tag:yaml.org,2002:str
.*tag:yaml.org,2002:str (Default)
YAML::PP (option empty=null)
/* Empty */tag:yaml.org,2002:null
.*tag:yaml.org,2002:str (Default)

YAML 1.2 Core Schema

Regular expressionResolved to tag
true | True | TRUE | false | False | FALSEtag:yaml.org,2002:bool
0o [0-7]+tag:yaml.org,2002:int (Base 8)
[-+]? [0-9]+tag:yaml.org,2002:int (Base 10)
0x [0-9a-fA-F]+tag:yaml.org,2002:int (Base 16)
[-+]? ( \. [0-9]+ | [0-9]+ ( \. [0-9]* )? ) ( [eE] [-+]? [0-9]+ )?tag:yaml.org,2002:float (Number)
[-+]? \. ( inf | Inf | INF )tag:yaml.org,2002:float (Infinity)
\. ( nan | NaN |NAN )tag:yaml.org,2002:float (Not a number)
null | Null | NULL | ~tag:yaml.org,2002:null
/* Empty */tag:yaml.org,2002:null
.*tag:yaml.org,2002:str (Default)

YAML 1.1 Types

Regular expressionResolved to tag
y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFFtag:yaml.org,2002:bool
[-+]? 0b [0-1_]+tag:yaml.org,2002:int (Base 2)
[-+]? 0 [0-7_]+tag:yaml.org,2002:int (Base 8)
[-+]? ( 0 | [1-9] [0-9_]* )tag:yaml.org,2002:int (Base 10)
[-+]? 0x [0-9a-fA-F_]+tag:yaml.org,2002:int (Base 16)
[-+]? [1-9] [0-9_]* ( : [0-5]? [0-9] )+tag:yaml.org,2002:int (Base 60)
[-+]? ( [0-9] [0-9_]* )? \. [0-9.]* ( [eE] [-+] [0-9]+ )?tag:yaml.org,2002:float (Base 10)
[-+]? [0-9] [0-9_]* ( : [0-5]? [0-9] )+ \. [0-9_ ]*tag:yaml.org,2002:float (Base 60)
[-+]? \. ( inf | Inf | INF )tag:yaml.org,2002:float (Infinity)
\. ( nan | NaN |NAN )tag:yaml.org,2002:float (Not a number)
null | Null | NULL | ~tag:yaml.org,2002:null
/* Empty */tag:yaml.org,2002:null
.*tag:yaml.org,2002:str (Default)
There are more types not listed here for YAML 1.1 (like '!!timestamp', '!!binary', '!!merge').