I'm new to Regex and I'm struggling in finding a string inside a pattern.
I have this string:
{"linha":""},
{"linha":" REDE GETNET"},
{"linha":" SANTANDER"},
{"linha":""},
{"linha":"20/04/15 09:07:32 AUT:006299 DOC:000235"},
{"linha":"EC:000000000370484 TERM: T0385403 M"},
{"linha":"CV:010000024 CAIXA:00003333"},
{"linha":""},
{"linha":"CARTAO ************2125"},
{"linha":""},
{"linha":" CREDITO A VISTA"},
{"linha":"VALOR: 12,00"},
{"linha":""},
{"linha":" ______________________________"},
{"linha":" ASSINATURA"},
{"linha":""},
{"linha":""},
{"linha":"CUPOM: 00000000000000 MAC: 9235"},
{"linha":"NSU_CTF: 001899 LOJA: 0019 PDV: 897"},
{"linha":""},
{"linha":""}
I'd like to find the ocurrences between:
{"linha":
and
},
Getting only the string in double quotes after colon.
Until now my regex is:
(\{".*(linha).[:])
and it's getting only
{"linha":
Can someone help me? I intend doing it in javascript.
/\{\s*\"linha\"\s*\:\s*\"(.*)\"\}/g? regex101.com/r/IjAJgB/1json_decodein PHP,JSON.parsein Javascript), then you can loop over the objects and extractlinhaproperties{"linha":"hello {\"world\"}!" },, or{"linha":null},or{"linha":123 },? Regex could fail in all sorts of weird ways (as well as being harder to understand/update!), and there is almost certainly a better simple solution.