[英]Regular Expression Notepad++ to Find & replace strings
I have strings like following in a line 我有像这样的字符串
Q80a_Offline_MElDor_NET Q80a_Offline_Mr_NET Q80a_Offline_Mor_NET Q80a_Offline_MElDor_NET Q80a_Offline_Mr_NET Q80a_Offline_Mor_NET
I want to remove _NET from them using regex in Notepad++. 我想在记事本++中使用正则表达式从其中删除_NET 。
I also have following in the same line in the file which I don't want to touch. 我也不想在文件的同一行中包含以下内容。
Q80a_MElDor_NET Q80a_Mr_NET Q80a_Mor_NET Q80a_MElDor_NET Q80a_Mr_NET Q80a_Mor_NET
I can find these strings with following search string. 我可以在下面的搜索字符串中找到这些字符串。
^Q80a_offline_[a-zA-Z]+_NET$ ^ Q80a_offline_ [A-ZA-Z] + _ NET $
but not sure what to use as replace with regex expression 但不确定用什么作为正则表达式替换
I want Q80a_Offline_MElDor_NET to be Q80a_Offline_MElDor 我希望Q80a_Offline_MElDor_NET是Q80a_Offline_MElDor
please help. 请帮忙。
_NET$
Try this.Replace by empty string
.See demo. 试试这个。用
empty string
替换。请参阅演示。
http://regex101.com/r/yR3mM3/55 http://regex101.com/r/yR3mM3/55
or 要么
^(Q80a_offline_[a-zA-Z]+)_NET$
Replace by $1
. 替换为
$1
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.