[英]Notepad++ regex replace - how to remove this string
I want to remove strings in the form of the following where some-text
is a random text string. 我想删除以下形式的字符串,其中
some-text
是随机文本字符串。
$('#some-text').val();
I've tried various things but I think the $
sign is messing things up since it's used in regex. 我已经尝试了各种方法,但是我认为
$
符号使事情搞砸了,因为它已在正则表达式中使用。
You need to escape some characters. 您需要转义一些字符。
Try this - 尝试这个 -
\$\('#[^']*'\)\.val\(\);
通过转义特殊字符来尝试此正则表达式:
\$\(.*\).val\(\);
To avoid escaping the special characters, you can use \\Q
- \\E
pair to surround the part where you want the regex engine to interpret literally: 为避免转义特殊字符,可以使用
\\Q
\\E
对将正则表达式引擎按字面解释的部分包围起来:
\Q$('\E<your-regex>\Q').val();\E
Replace <your-regex>
with your regex to match the selector, or whatever it is. 将
<your-regex>
替换为<your-regex>
表达式以匹配选择器或其他选择器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.