我想用 Vim 从一段文本中提取一些数据。输入看起来像这样:
72" title="(168,72)" onmouseover="posizione('(168,72)');" onmouseout="posizione('(-,-)');">>
72" title="(180,72)" onmouseover="posizione('(180,72)');" onmouseout="posizione('(-,-)');">>
72" title="(192,72)" onmouseover="posizione('(192,72)');" onmouseout="posizione('(-,-)');">>
72" title="(204,72)" onmouseover="posizione('(204,72)');" onmouseout="posizione('(-,-)');">>
我需要提取的数据包含在title="(168,72)"
输入的部分。我特别感兴趣的是提取括号中的坐标对。
我想过先用Vim删除之前的所有内容title="
,但我并不是真正的正则表达式专家,所以我问你。如果有人有任何提示,请告诉我! :)
这会将每行替换为每行制表符分隔的坐标列表:
:%s/.* title="(\(\d\+\),\(\d\+\))".*/\1\t\2
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)