Pavallo's Tech Pit
Thursday, 7 November 2019
Parsing Gremlin console output into JSON (with node)
JSON.parse("[" + str.trim().replace(/==>/g,"").replace(/\n/,",").replace(/([a-zA-Z0-9]+)=/g, '"$1": ').replace(/\[([a-zA-Z0-9_.//]+)\]/g, '["$1"]').replace(/\["(\d+)"\]/g, "[$1]").trim() + "]")
No comments:
Post a Comment
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment