regex - Sublime Text 3 syntax definition: how to capture a multiline C-style block comment? -
so target block this:
/* comments more end */
anything between /*
, */
considered comment. current rule captures single line comments:
match: \/\*(\w|\s|\w|\n|\r\n)*\*\/
i know sublime text uses oniguruma i'm not sure how match multilines.
ok. joachim pileborg's comment helpful. here's how did it.
approach
1- install packagedev package.
2- copy relevant package temporary directory , unzip it. c
, did this:
cp /applications/sublime text.app/contents/macos/packages/c++.sublime-package ~/tmp cd ~/tmp unzip c++.sublime-package
unzipping create many *.tmlanguage
files.
3- open c.tmlanguage
in sublime.
4- command palette, choose build with: covert ... yaml (block style)
create c.yaml-tmlanguage
.
5- open yaml
file , copy regex need.
answer
for c-style blocks, rule worked:
- begin: /\* captures: '0': name: punctuation.definition.comment.mn end: \*/ name: comment.block.c
Comments
Post a Comment