View Single Post
04/13/21, 12:08 PM   #1
scorpius2k1
 
scorpius2k1's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2019
Posts: 6
Exclamation [open] Please add LUA support for frontier pattern matching

ESO LUA string.find does not support standard frontier pattern %f[set] matching. This is very useful for addons, etc, needing to find whole words in strings. Both of these code snippets should return YES since the match 'word' is there in the string (which is the expected result), but they do not. A standalone LUA compiler returns YES while ESO returns NO using the same code.

Note: This is the same result for 'zo_strfind' which has the same unsupported result.

More information here:
https://github.com/lua/lua/blob/eadd...anual.of#L7485
http://lua-users.org/wiki/FrontierPattern

Standalone LUA Interpreter with support, Returns YES (expected)
Lua Code:
  1. local text = "there is a word here"
  2. local match = "%f[%a]word%f[%A]"
  3.  
  4. if string.find(text, match) then
  5.     print("YES")
  6. else
  7.     print("NO")
  8. end

ESO/Havok LUA Interpreter, Returns NO (unsupported)
Lua Code:
  1. local text = "there is a word here"
  2. local match = "%f[%a]word%f[%A]"
  3.  
  4. if string.find(text, match) then
  5.     d("YES")
  6. else
  7.     d("NO")
  8. end

All the best, thanks for your time!

Last edited by scorpius2k1 : 04/13/21 at 12:17 PM.
  Reply With Quote