Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { scopeName = 'source.regexp.oniguruma';
- comment = "Matches Oniguruma's Ruby regexp syntax (TextMate uses Oniguruma in Ruby mode).";
- fileTypes = ( 're' );
- foldingStartMarker = '(/\*|\{|\()';
- foldingStopMarker = '(\*/|\}|\))';
- patterns = (
- { name = 'keyword.control.anchor.regexp';
- match = '\\[bBAZzG]|\^|\$';
- },
- { name = 'constant.character.numeric.regexp';
- match = '\\([0-7]{3}|\\x(\h\h|\{\h{,8}\}))';
- },
- { name = 'keyword.other.back-reference.regexp';
- match = '\\[1-9]\d*';
- },
- { name = 'keyword.other.back-reference.named.regexp';
- match = '(\\k\<)[a-z]\w*(\>)';
- captures =
- { 1 = { name = 'keyword.other.back-reference.named.regexp'; };
- 2 = { name = 'entity.name.back-reference'; };
- 3 = { name = 'keyword.other.back-reference.named.regexp'; };
- };
- },
- { name = 'constant.other.character-class.posix.regexp';
- match = '\[\:(\^)?(alnum|alpha|ascii|blank|cntrl|x?digit|graph|lower|print|punct|space|upper)\]';
- },
- { name = 'keyword.operator.quantifier.regexp';
- match = '[?+*][?+]?|\{(\d+,\d+|\d+,|,\d+|\d+)\}\??';
- },
- { name = 'keyword.operator.or.regexp';
- match = '\|';
- },
- { name = 'comment.block.regexp';
- begin = '\(\?\#';
- end = '\)';
- },
- { name = 'keyword.other.option-toggle.regexp';
- match = '\(\?[imx-]+\)';
- },
- { name = 'meta.group.assertion.regexp';
- begin = '(\()((\?=)|(\?!)|(\?<=)|(\?<!))';
- end = '(\))';
- beginCaptures =
- { 1 = { name = 'keyword.control.group.regexp'; };
- 3 = { name = 'meta.assertion.look-ahead.regexp'; };
- 4 = { name = 'meta.assertion.negative-look-ahead.regexp'; };
- 5 = { name = 'meta.assertion.look-behind.regexp'; };
- 6 = { name = 'meta.assertion.negative-look-behind.regexp'; };
- };
- endCaptures = { 1 = { name = 'keyword.control.group.regexp'; }; };
- patterns = ( { include = '$self'; } );
- },
- { name = 'meta.group.regexp';
- begin = '(\()((\?(>|[imx-]*:))|(\?<)([a-z]\w*)(>))?';
- end = '(\))';
- beginCaptures =
- { 1 = { name = 'keyword.control.group.regexp'; };
- 3 = { name = 'keyword.other.group-options.regexp'; };
- 5 = { name = 'keyword.other.group-options.regexp'; };
- 6 = { name = 'entity.name.group.regexp'; };
- 7 = { name = 'keyword.other.group-options.regexp'; };
- };
- endCaptures = { 1 = { name = 'keyword.control.group.regexp'; }; };
- patterns = ( { include = '$self'; } );
- },
- { include = '#character-class'; },
- );
- repository = { character-class = { patterns = (
- { name = 'constant.character.character-class.regexp';
- match = '\\[wWsSdDhH]|\.';
- },
- { name = 'constant.character.escape.backslash.regexp';
- match = '\\.';
- },
- { name = 'constant.other.character-class.set.regexp';
- begin = '(\[)(\^)?';
- end = '(\])';
- beginCaptures =
- { 1 = { name = 'keyword.control.character-class.regexp'; };
- 2 = { name = 'keyword.operator.negation.regexp'; };
- };
- endCaptures = { 1 = { name = 'keyword.control.character-class.regexp'; }; };
- patterns = (
- { name = 'constant.other.character-class.range.regexp';
- match = '(.|(\\.))\-([^\]]|(\\.))';
- captures =
- { 2 = { name = 'constant.character.escape.backslash.regexp'; };
- 4 = { name = 'constant.character.escape.backslash.regexp'; };
- };
- },
- { name = 'keyword.operator.intersection.regexp';
- match = '&&';
- },
- { include = '#character-class'; },
- );
- },
- );
- };
- };
- }
Add Comment
Please, Sign In to add comment