英文:
Regex: Not operator with grouped selection
问题
如下模式(currentStore.*?\}.*?=.*?useApp)
用于搜索以下模式:
const {currentStore} = useApp();
但我需要一个模式,用于搜索分配currentStore
的内容,如下(Not(currentStore.*?\}.*?=.*?useApp)
):
currentStore = await MultiStoreService.getStoreInfoByLocation(zipCode, subdistrict);
我的意思是,不符合上述条件的条件,没有获得选项,如果没有合适的解决方案,欢迎提出建议。即使在编辑原始问题时提出建议也是受欢迎的。
英文:
As below pattern (currentStore.*?\}.*?=.*?useApp)
which search for a pattern like this:
const {currentStore} = useApp();
But I need a pattern which search for a content where assignation of currentStore
is happening like below(Not(currentStore.*?\}.*?=.*?useApp)
):
currentStore = await MultiStoreService.getStoreInfoByLocation(zipCode, subdistrict);
I mean conditions which do not follow above conditions
not getting an option, welcoming suggestion if proper solution is not available.
Even if suggestion over edition original question is also welcome.
答案1
得分: 1
匹配任何分配给 currentStore
的行:
^.*?currentStore\W+=[^;]+;
查看在线演示。
答案2
得分: 1
当前存储 = await\s+[a-zA-Z_][a-zA-Z_0-9].[a-zA-Z_][a-zA-Z_0-9](.*);
英文:
maybe this will help
currentStore = await\s+[a-zA-Z_][a-zA-Z_0-9]*\.[a-zA-Z_][a-zA-Z_0-9]*\(.*\);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论