问题
What type of Regex is Sublime Text 3 using? Posix? Posix Extended?
回答1:
Sublime's Search and Search and Replace functions, along with snippets, are powered by Boost's pcre (Perl-Compatible Regular Expressions) engine, while the syntax highlighting language definitions (.tmLanguage
or .sublime-syntax
files) use the oniguruma engine, which Ruby also uses.
回答2:
Well this is odd. On regex101.com
with it set to pcre
, I have a substitution that works perfectly. Yet in sublime text 3, it does not.
try the following on the site and in ST3
:
regex find: (testing.*)(0\.001\;)
replace: $10.00;
test text:
//ActionList = testing { Name = "foo"; On = 0.001; Off = 1; v = "tester";};
来源:https://stackoverflow.com/questions/35343933/type-of-regex-used-by-sublime-text-3