ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Wish List (https://www.esoui.com/forums/forumdisplay.php?f=177)
-   -   [open] Please add LUA support for frontier pattern matching (https://www.esoui.com/forums/showthread.php?t=9687)

scorpius2k1 04/13/21 12:08 PM

[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!

@DeadSoon 09/05/21 01:52 PM

Quote:

Originally Posted by scorpius2k1 (Post 43710)
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. :)


All times are GMT -6. The time now is 08:36 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI