【发布时间】:2021-05-02 16:09:20
【问题描述】:
我在 R 中有一个长字符串,其中包含一系列具有这种模式的值:
list <- '{s:K_01.01, y:01}="whatever" and {s:K_02.01, y:02}="whatever" and {s:K_03.01, y:03}="whatever" and {s:K_01.01, y:01}="whatever2" and {s:K_01.01, y:01}="whatever3"'
我想在数据框中提取并存储一列,其中包含以 {s:K_01.01 开头并以 " 结尾的所有字符串,并且忽略所有其他字符串。
预期输出:
{s:K_01.01, y:01}="whatever"
{s:K_01.01, y:01}="whatever2"
{s:K_01.01, y:01}="whatever3"
有人知道怎么做吗?
【问题讨论】:
标签: r regex regex-lookarounds