简体   繁体   English

如何使用Regex删除Notepad ++中两个字符串之间的文本?

[英]How to use Regex to remove text between two strings in Notepad++?

I have many lines like this : 我有很多这样的话:

#EXTINF:-1 tvg-name="test" tvg-logo="http://somsite.com/test.png" group-title="stars",test
Name=sun_SEASON/STAR_NOVA&title=galaxy

and want to change it to : 并希望将其更改为:

#EXTINF:-1 tvg-name="test" tvg-logo="http://somsite.com/test.png" group-title="stars",test
Name=sun_SEASON&title=galaxy

removing everything between Season/ AND & 删除Season / AND&之间的所有内容

i tried to use this search for : 我试图使用此搜索:

SEASON/[^<>]+&title=galaxy

and replace with: 并替换为:

SEASON&title=galaxy

But it didnot work! 但这没有用! could any one tell me what i am doing wrong ? 有人能告诉我我做错了吗?

SEASON(/[^&]+)&title=galaxy

delete $1 删除$ 1

or 要么

(?<=Name=sun_SEASON).*?(?=&)

delete 删除

How about: 怎么样:

  • Ctrl + H Ctrl + H
  • Find what: (?<=SEASON)[^&]+(?=&) 查找内容: (?<=SEASON)[^&]+(?=&)
  • Replace with: NOTHING 替换为: NOTHING
  • Replace all 全部替换

This will replace by nothing (ie delete) everything that is between SEASON and & 这将不替换(即删除) SEASON&之间的所有内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM