go-peg icon indicating copy to clipboard operation
go-peg copied to clipboard

Unicode Regular Expression support

Open yhirose opened this issue 6 years ago • 1 comments

https://github.com/yhirose/go-peg/issues/6#issuecomment-466736815

Plus another question, is there a way to define a Unicode string in rules? eg:

https://stackoverflow.com/questions/30482793/golang-regexp-with-non-latin-characters

STRING_LIT = < [\\p{L}\\d_]+>

It will be convenient to define query DSL as following:

a = '世界' and b = 1

yhirose avatar Mar 02 '19 16:03 yhirose

@cch123, it's possible though, the Unicode regex spec is massive: http://unicode.org/reports/tr18/ https://www.regular-expressions.info/unicode.html

It would be easy to start with the Unicode Categories first such as \p{L}.

yhirose avatar Mar 02 '19 16:03 yhirose