I have a vector of strings and I would like to parse it. However, the brackets in combinations with quotes make this quite complicated. I would like to solve this preferably with stringr
(not a requirement)
x = c("[\"DER001_A375_96H:TRCN0000052583:-666\"]", "[\"TRCN0000052583\"]", "[\"AAK1\",\"AARS\"]", "[\"A375\"]", "-6.7389873 ... 4.6063291")
> x
[1] "[\"DER001_A375_96H:TRCN0000052583:-666\"]" "[\"TRCN0000052583\"]"
[3] "[\"AAK1\",\"AARS\"]" "[\"A375\"]"
[5] "-6.7389873 ... 4.6063291"
Expected result:
DER001_A375_96H:TRCN0000052583:-666
TRCN0000052583
AAK1
AARS
A375
6.7389873
4.6063291