我想在正则表达式中找到一个后跟}
字符的新行,但我不认为它只找到\ n(?):
{
"keys": ["ctrl+m"],
"command": "run_macro_file",
"args":
{"file": "Packages/User/JavaScript/finPointvirguleRetourligne.sublime-macro"}, "context":
[
{
"key": "following_text",
"operator": "regex_contains",
"operand": "\n[}]",
"match_all": true
}
]
}
所以
"operand": "\n[}]"
不起作用,
也不起作用"operand": "\n"
在参数\n
的上下文中, following_text
似乎对他没有任何意义
我也找到了使用\n(\s)*\{
的下一个表达式,它在Sublime中使用Ctrl + F可以正常工作,但在此正则表达式中不被接受(文件不解析)
编辑:此宏用于在一行末尾添加分号;
,然后转到新行,但只有在该行中没有'}'时才会下一行(因为我不想创建新行)