正则表达式:查找不以 X 开头的字符串 [英] Regex: Finding strings that doesn't start with X

查看:63
本文介绍了正则表达式:查找不以 X 开头的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对正则表达式完全无望...

I am completely hopeless with regular expressions...

我有一个名为 #addButton 的 Velocimacro,我有一个名为 addButton() 的 JS 函数.现在我想找到所有调用 JS 函数的地方.所以我需要搜索addButton",其中addButton"以哈希键开头.

I have a Velocimacro named #addButton, and I have a JS function named addButton(). Now I want to find all the places the JS function is called. So I need to search for "addButton", where "addButton" doesn't start with the hash key.

有什么想法吗?

推荐答案

/([^#]|^)addButton/

它将匹配addButton"不是前面有#"或字符串开头的每个字符串.

It will match every string where "addButton" is not preceded by "#" or the beginning of the string.

这篇关于正则表达式:查找不以 X 开头的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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