0

I need to write some regex to improve C++.tmLanguage file. For example I want to highlight assertions from Google Test framework. Example:

ASSERT_EQ(expected, actual);

so I wrote this:

ASSERT_[A-Z_]+

but when I'm adding open parenthesis highlight is broken. Also I would like to highlight function name after range operator, example:

Foo::function()

but same issue here.

Please help.

Edit:

Maybe other regex from .tmLanguage interfere in some way? I've tried several solutions, all of them worked in web regex testers, but still no effect in Sublime.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
msw
  • 95
  • 1
  • 6
  • did you try this `ASSERT_[A-Z_\W]+`? – Avinash Raj Sep 05 '14 at 10:01
  • How do you add the paren? Maybe you need to escape it `\(`. – Xælias Sep 05 '14 at 14:57
  • What exactly do you want to match? Please [edit] your question to very carefully describe **exactly** what you're trying to do, **exactly** which regexes you're trying, and **exactly** what your results are. As a regex aid, use http://rubular.com/ and select Ruby 1.9.2 at the bottom - that's the same regex flavor as being used by Sublime. – MattDMo Sep 05 '14 at 21:15

1 Answers1

0

ASSERT_EQ is highlighted in Sublime Text 3's C++ mode.

bolav
  • 6,938
  • 2
  • 18
  • 42