Reputation: 7324
I have this regex
^\([^\t]*\)\t\([^\t]*\)\t\([^\t]*\)$
which is supposed to match
But in Sublime it will not match. Why?
Upvotes: 5
Views: 164
Reputation: 626691
Vim regex is rather specific and differs from the PCRE regex engine expression syntax that Sublime Text 3 uses.
In Sublime Text 3, you can write the pattern you used in Vim as
^([^\t\r\n]*)\t([^\t\r\n]*)\t([^\t\r\n]*)$
See the regex demo
In short, (...)
should be used to form a capturing group, and you need to add \r\n
to disallow a negated character class to match across lines (in Vim, [^.]*
won't match a line break, but it will in Sublime Text 3).
Note that (...)
(and not \(...\)
) can also be used as a capturing group in Vim, but you need to use very magic mode to use that syntax.
Upvotes: 5