In Antlr4 grammar I need to match with the help of Regular Expressions Latin,Cyrillic,Polish and Greek Letters plus special characters. This is what I have:
STRING: ['][\p{L} 0-9\[\]\^\$\.\|\?\*\+\(\)\\~`\!@#%&\-_+={}""<>:;,\/°]*['];
So I am saying that a String
starts and ends with ''
. Inside I can have any letter (\p{L}
), number and special character except from '
. I have tested this on regex101.com and it exactly what I want. But in Antlr4 it is not working. Instead the closest thing I get is:
['][a-zA-Z0-9 \[\]\^\$\.\|\?\*\+\(\)\\~`\!@#%&\-_+={}""<>:;,\/°]*[']
But the Problem is that something like 'Ąłćórżnęł'
won't be accepted in my language, but it should be.
Am I doing something wrong in Antlr4 or is that a limitation ? How could I manage to get it to work in Antlr4 ? String is a Lexer Rule.