{"ScriptPreparationCode":"text = \u0060\r\nTue Aug 2 12:51:56.205 UTC\r\n-------------------------------------------------------------------------------\r\n0/0/CPU0\r\n-------------------------------------------------------------------------------\r\nInterface Address Version Refcount Protocol\r\nGi0/0/0/0 (src mac only) 19 2( 0) ipv4 \r\n 0000000000000200330011000800\r\n mtu: 1500, flags 1 1\r\n 0 packets, 0 bytes\r\nGi0/0/0/3.151 (src mac only) 32 2( 0) ipv4\r\n 000000000000020033001103810000970800\r\n mtu: 1500, flags 1 1\r\n 0 packets, 0 bytes\r\nGi0/0/0/3.157 10.33.157.112 71 2( 0) ipv4 \r\n 0200330012030200330011038100009d0800\r\n mtu: 1500, flags 1 0\r\n 0 packets, 0 bytes\r\nGi0/0/0/2 10.33.129.110 35 2( 0) ipv4\r\n 001fca08e9970200330011020800\r\n mtu: 1500, flags 1 0\r\n 341164 packets, 29461677 bytes\r\nGi0/0/0/3.155 (src mac only) 28 2( 0) ipv4\r\n 0000000000000200330011038100009b0800\r\n mtu: 1500, flags 1 1\r\n 0 packets, 0 bytes\r\nGi0/0/0/0 10.33.131.112 63 2( 0) ipv4\r\n 0200330012000200330011000800\r\n mtu: 1500, flags 1 0\r\n 106 packets, 21749 bytes\r\nGi0/0/0/3.156 10.33.156.112 67 2( 0) ipv4\r\n 0200330012030200330011038100009c0800\r\n mtu: 1500, flags 1 0\r\n 0 packets, 0 bytes\r\nGi0/0/0/3.150 10.33.150.13 40 2( 0) ipv4\r\n aabbcc82a400020033001103810000960800\r\n mtu: 1500, flags 1 0\r\n 280344 packets, 15436343 bytes\r\n\u0060;\r\n\r\n\r\nregex = /^\\s*(?\u003CnameOriginal\u003E\\S\u002B)\\s\u002B\\S\u002B\\s\u002B(?:up|down)\\s\u002B(?:up|down)/i;\r\nnamedRegex = /^\\s*(?\u003CnameOriginal\u003E\\S\u002B)\\s\u002B\\S\u002B\\s\u002B(?:up|down)\\s\u002B(?:up|down)/gmi;\r\n\r\nkeys = [\u0027intL3Name\u0027, \u0027ip\u0027, \u0027mac\u0027];","TestCases":[{"Name":"iterator","Code":"const allMatchs = text.matchAll(namedRegex);\r\n \r\nfor (const matchs of allMatchs) {\r\n console.log(matchs)\r\n for (let index = 0; index \u003C keys.length; index \u002B\u002B) {\r\n let match = matchs[index \u002B 1];\r\n console.log(\u0060key: ${key[index]}, match: ${match}\u0060)\r\n }\r\n}","IsDeferred":false},{"Name":"rows","Code":"const rows = text.split(/\\n/);\r\nconst result = rows.reduce((acc, row) =\u003E {\r\n const arrMatches = row.match(regex);\r\n if (arrMatches){\r\n arrMatches.slice(1).forEach((v, index) =\u003E {\r\n console.log(\u0060key: ${v}, index: ${index}\u0060) \r\n })\r\n }\r\n})\r\n","IsDeferred":false}]}