[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Matching multibyte alphabetical characters with LPeG
- From: Hinrik Ãrn SigurÃsson <hinrik.sig@...>
- Date: Sun, 17 Jun 2012 03:40:08 +0000
I've been making a parser with LPeG and I've run into the issue that I can't
match non-ASCII words even though I'm using a utf8 locale. It seems that
"alpha" (and "alnum", etc) from lpeg.locale() don't match anything beyond ASCII.
See the following code:
local lpeg = require 'lpeg'
local locale = lpeg.locale()
print(lpeg.match(lpeg.C(lpeg.P("Ã")), "Ã")) --> Ã
print(lpeg.match(lpeg.C(locale.alpha), "Ã")) --> nil
Is there an easy way to match non-ASCII alphabetical characters with LPeG?
If not, can LPeG be patched to support it?