lua-users home
lua-l archive

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


I just noticed a glitch while trying to test out the 're' module for Lpeg....

string reverse example
> rev = re.compile[[ R <- (!.) -> '' / ({.} ) -> '%2%1']]
> print(rev:match"0123456789")   --> 9876543210
stdin:1: invalid capture index (2)
stack traceback:
	[C]: in function 'match'
	stdin:1: in main chunk
	[C]: ?

looking at it, it looks like the re expression is wrong, rather than 're' having a bug.