【发布时间】:2016-05-22 12:01:06
【问题描述】:
Sublime Text 3 使用什么类型的正则表达式? 正则表达式? Posix 扩展?
【问题讨论】:
标签: regex sublimetext3
Sublime Text 3 使用什么类型的正则表达式? 正则表达式? Posix 扩展?
【问题讨论】:
标签: regex sublimetext3
Sublime 的 Search 和 Search 和 Replace 功能,以及 sn-ps、are powered by Boost 的 pcre(Perl 兼容的正则表达式)engine,同时语法高亮语言定义(.tmLanguage 或 .sublime-syntax 文件) 使用 oniguruma engine,Ruby 也使用它。
【讨论】:
/foo/bar/i 工作正常。在 Find 框中,不要使用正斜杠,也不要在末尾放置选项,而是 Find: (?i)foo Replace: bar。
这很奇怪。在regex101.com 上,它设置为pcre,我有一个完美的替换。然而在崇高的文本 3 中,它没有。
在网站和ST3 中尝试以下操作:
regex find: (testing.*)(0\.001\;)
replace: $10.00;
test text:
//ActionList = testing { Name = "foo"; On = 0.001; Off = 1; v = "tester";};
【讨论】:
$。当我改用 \10.00; 时,它按预期工作。