下面是示例文本。
Header
This is test, and
mid line adsf
bag a lot of many things
shoes>
shoes/
This line should not be affected.
Neither this line.
This is test, and
mid line
bag a lot of many things
shoes>
shoes/
Footer
需要替换/删除文本以This is test
开始并以
shoes>
shoes/
使用Notepad ++ 7.5
RegEx的新手,以下是我的试用,未能选择多个实例。
(This is test).*(shoes/)
^This is test.*shoes/$
预期输出为
Header
This line should not be affected.
Neither this line.
Footer
答案 0 :(得分:1)
^This is test((.|\n|\r)*?)shoes/$
应该匹配;它考虑了换行符。编辑:根据{Wiktor的评论,^This is test(?s:.*?)shoes/$
会更短和更好。