1# YAML test 2 3# Comment 4 5key: value 6another key: Another value 7boolean: true 8null_value: null 9single quotes: 'have ''one'' escape pattern' 10double quotes: "have many: \", \0, \t, \u263A, \x0d\x0a == \r\n, and more." 11 12decimal: +12345 13negative: -1_4 14zero: 0 15octal: 0o14 16another octal: 014_2 17hexadecimal: 0x_Ca2 18float: 1.23015e+3 19exponential: 12.3015e+02 20fixed: 12__30.1_5 21sexagesimal: 19_0:20:30.15 22sexagesimal-inline: [123:45:12, 123:45:32.234_32, +12__3:23] 23infinity: !!float .inf 24not a number: !!float .NaN 25datetime: 2001-12-15T02:59:43.1Z 26date: 2002-12-14 27 28json_map: {"key": "value"} 29json_seq: [3, 2, -.inf, "value"] 30another key: {key: [+0x12a, , !!hello: bye, 1, off, {a: [{b: ''}]}]} 31 32? !!python/tuple [5, 7] 33: Fifty Seven 34 35? set2: 36 item1: null 37 item2: null 38 39foo: &foo 40 <<: *base 41 age: 10 42 43!!seq [ 44 !!str "Block scalar\n", 45 !!map { 46 ? &B1 !!str "foo" 47 : !!str "bar", 48 ? !!str "baz" 49 : *B1, 50 }, 51 !!map { 52 !!str "sun" : !!str "yellow", 53 }, 54] 55 56!!map { 57 !!str "Booleans": !!seq [ 58 !!bool "true", !!bool "false" 59 ], 60 !!str "Invalid": !!seq [ 61 # Rejected by the schema 62 True, Null, 0o7, 0x3A, +12.3, 63 ], 64} 65 66--- !clarkevans.com,2002/graph/^shape 67- !^circle 68 center: &ORIGIN {x: 73, y: 129} 69 radius: 7 70 71? - Dog 72 - Cat 73: [ 2018-08-11, 2016-01-01 ] 74 75# Literal/Folded Style 76 77--- | 78 \//||\/|| 79 // || ||__ 80 81--- > 82 Mark McGwire's 83 year was crippled 84 by a knee injury. 85 86? | 87 This is a key 88 that has multiple lines 89: | 90 and this is it's literal value 91 92# Capture the indentation of the Key. The "-" and "?" operators 93# are considered as part of the indentation: 94key1: 95 key2: !!hello | 96 literal: " text" # [ ] 97 98 # literal { } 99 key3: |+ 100 literal: 'text' 101 no-literal: " text" 102 #comment 103 104? key: |- 105 literal: "text" 106 no-literal: "text" 107- item1 108 - item2 109 - - - key: >- 110 "literal text" # [ ] 111 112 'literal block' 113 no-literal: 12 114 115? - - - - ? key: | 116 literal: [ ] 117 no-literal: [ ] 118 119# Capture the indentation of the literal/folded operator: 120|- 121 literal: "text" 122 123!!binary | 124 R0lGODlhDAAMAIQAAP//9/X 125 17unp5WZmZgAAAOfn515eXv 126 Pz7Y6OjuDg4J+fn5OTk6enp 127 56enmleECcgggoBADs= 128 129key1: 130 key2: 131 | 132 literal: "text" 133 key3: 134 !!str | 135 literal: "text" 136 #literal 137 138# Capture the indentation of the operators "-" or "?": 139? - - - !!hello |+ 140 literal: "sdfsd" # [ ] 141 no-literal: "sdfsd" # [ ] 142 143- - - - >- 144 literal: "text" 145 #literal 146 no-literal: "text" 147 148# This implementation of literal blocks has a limitation: 149# it only supports 6 dashes at most. 150- - - - - - - key: | 151 literal? "dfsf" 152 153# Only comments after spaces & strings in multiline attributes (bug #407060) 154reg_list: 155- reg: ?#XPath //div[@class="product_item cf"][@id] ))(?sx) 156 id="product(?P<code>[^"]+)" 157 .+?<h4><a\s+[^>]+>(?P<title>[^<]+)</a></h4> 158