![](/img/trans.png)
[英]Use regex in R to delete all characters in a string except specified words
[英]Vim substitute: Delete All between specified words
我試圖削減的一塊文件
HTMName=[...] owns the means of production. Proletariat do not and sell their labor power.
HTMFile=x
ClickPlay=0
TestElement=0
Type=HTML
Cors=123
DisplayAt=215
Hyperlink=0
HTMName=Bourgeois
HTMFile=x
ClickPlay=0
最終結果
[...] owns the means of production. Proletariat do not and sell their labor power.
Bourgeois
我知道文件的頂部和底部將有剩余部分。 我嘗試了以下內容
:s%/^\sHTMFile[\s\S]*\n\s*HTMName=$//g
還有許多其他變化都沒有找到任何模式。 我對正則表達式的掌握非常微弱。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.