我对 regex 或 Notepad++ 知之甚少,但我希望这是寻求帮助的正确地方。我正在处理一个大约 1000 行的 .txt 文件。每条线看起来像
\newlabel{name}{{number}{another number}{part I do not want}{another part I do not want}{}}
但我想要
\newlabel{name}{{number}{another number}}
例如,我想
\newlabel{inf-just}{{905}{762}{\hspace *{.1in}Infinity}{meti.905}{}}
\newlabel{n-ary-op}{{877}{741}{Numerical Operations}{meti.877}{}}
成为
\newlabel{inf-just}{{905}{762}}
\newlabel{n-ary-op}{{877}{741}}
我完全超出了我的深度,所以我非常感谢有关如何做到这一点的建议。先感谢您!
好吧,对于您给定的示例,此代码是有想法的。
查找:^(\\.*?\d+}{\d+}).*
全部替换:$1}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句