lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2012/11/6 Xavier Wang <weasley.wx@gmail.com>:
>
> now Lua don't support ?,*,+,- on a so-called sub-pattern, but from the
> source, to add this support is easy: we can add a special %r (means
> recurse) modifier, so as:
> ("catcatcat"):match "%r(cat)+"
> returns
> catcatcat
>
> the idea is call match repeatly with sub-pattern on subject. all
> captures in %r sub-pattern is dropped. only use it to match
> multi-pattern in pattern.
>
> has someone interesting it? or is it a good idea about Lua5.3/6? hope
> for your comments :-)

Do you have a source patch providing this %r pattern (not all of
your unicode) so we can try it out?