在Notepad ++中查找第n个字符串的实例 [英] Find nth instance of a string in Notepad++

查看:2152
本文介绍了在Notepad ++中查找第n个字符串的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Notepad ++的正则表达式功能在文本文档中找到字符串ISA的第99个实例。我试图使用正则表达式



如果要用<$ c $替换 ISA 的第98次出现c> USA ,使用(?s)((?:。*?ISA){97}。*?)ISA regex并使用 $ 1USA 作为替换。


I'm trying to use the regular expression functionality of Notepad++ to find every 99th instance of the string "ISA" in a text document. I tried to use the regex here, but I keep getting the following error: Error message

Any help would be much appreciated!

解决方案

You may enable . matches newline option, or just use an inline singleline/dotall modifier (?s):

(?s)(?:.*?ISA){98}

See the settings with the result of Find All in Current Document (with some 300 1 ISA lines):

If you want to replace the 98th occurrence of ISA with, say, USA, use (?s)((?:.*?ISA){97}.*?)ISA regex and use the $1USA as the replacement.

这篇关于在Notepad ++中查找第n个字符串的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆