lua-users home
lua-l archive

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


I post this about a month ago.  I've found a simple lpeg re pattern for above

It can handle "repeated" separactor too, say, "(.*)andand(.*) too.

pat = re.compile( "{ (.(g <- &%z / .g))* } %z {.*}", { z = 'and' } )

note: the loop never match the first position, but it is ok
the second %z take care of of text with %z up front.