Posted 15 January 2013 - 12:19 PM
Say I'm trying to match something like a function call. Here's what I expect to happen (based on Lua's behavior outside Minecraft):
But here's what I get in CC:
From what I can tell, using %b in your search pattern always throws that Java error unless a match is found (in which case it does what it's supposed to).
lua> print(string.find("abc(123)", "([%w_]+)(%b())"))
1 8 abc (123)
lua> print(string.find("abc", "([%w_]+)(%b())"))
nil
But here's what I get in CC:
lua> print(string.find("abc(123)", "([%w_]+)(%b())"))
18abc(123)
lua> print(string.find("abc", "([%w_]+)(%b())"))
lua:1: vm error:
java.lang.ArrayIndexOutOfBoundsException
From what I can tell, using %b in your search pattern always throws that Java error unless a match is found (in which case it does what it's supposed to).