|
>patt = "[%a_][%w_]*"
> How to represent the pattern ([a-z]|[A-Z]|_)+([a-z]|[A-Z]|[0-9]_)* in Lua's format pattern.
>
> I tried
>
> patt = '([a-z]|[A-Z]|_)+([a-z]|[A-Z]|[0-9]_)*'
>
> string.match( '_id', patt )
>
print (string.match("_id",patt)) --> _id
print (string.match("A_1.",patt)) --> A_1
I find Lua's patterns much more intuitive than variations of regex.
Dirk