vim syntax highlight match group doesn't match with all cases

39 Views Asked by At

I try to create a syntax highlight match group that match all words only with capital letters with underscores (constants in Java).

My definition:

syn match javaConstants "[A-Z_]\{2,}"

works with the following cases:

public static String HELLO = "dasdsa"
String test = HELLO;
HttpStatus.NOT_FOUND

but fails with:

return new ResponseEntity<Student>(HttpStatus.NOT_FOUND);

Cases with above javaConstants group:

Cases with above javaConstants group

0

There are 0 best solutions below