lua-users home
lua-l archive

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


Patrick Donnelly wrote:
As far as I know, the only cause of this error is capture indices that are out-of-bound:

a,b,c,d = string.find("my dog's name is skip", "([\"'])(.-)%3") --error!

Another cause is using forward reference instead of back reference:

  print(string.find("aa", "(a)%1")) --> fine
  print(string.find("aa", "%1(a)")) --> error

Perhaps I was too specific for my own good, and should have just plainly asked what causes this error. : (

This would be much better, because the example in the original post was presented as the actual code causing the error:

My problem is this works fine for English, but when I use this for
                ^^^^                                        ^^^^
a German locale I receive the error: Invalid Capture Index. I'm
really confused about what is going wrong here, mostly because I
don't understand this error.

Sorry for nitpicking.

--
Shmuel