Thread Tools Display Modes
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
09/05/21, 01:52 PM   #2
@DeadSoon
AddOn Author - Click to view addons
Join Date: Sep 2018
Posts: 22
Originally Posted by scorpius2k1 View Post
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.
I absolutely support this request. I was also totally surprised when I found this out for myself.

I hope that this basic feature will be supported in the future.
  Reply With Quote

ESOUI » Developer Discussions » Wish List » [open] Please add LUA support for frontier pattern matching

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off