[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Invalid Capture Index
- From: Patrick Donnelly <batrick@...>
- Date: Fri, 6 Jul 2007 08:07:16 -0600
> You should have given the German string giving the error, so we can
> reproduce the problem.
> A possible source of trouble is the definition of %w:
> "%w: represents all alphanumeric characters."
> So if your names has German accented characters, your _expression_ won't work.
> Tried with "Däve goes to Brîtain", I didn't get your error, but 've' and
> 'Bri' as result.
> With "Dävé goes to ßrîtain", I got empty strings, so I cannot reproduce
> the problem.
> Note that indicating the version of Lua you use can also help us.
Yes I apologize for not providing the German string. The actual source of the problem was the German strings were using "%d$s" instead of "%s" in the unformatted strings, where d is a digit ("%%%d+%$s" as a lua pattern). I had to dig around, but I found that having a "%%%d+" inside a pattern without any captures (or the correct "index" capture) causes the error.
"One of the lessons of history is that nothing is often a good thing to do and always a clever thing to say."