string.find interprets its first parameter as a Lua pattern by default. The dash is a metacharacter matching the preceding item zero or more times (non-greedily) and the dot accepts any character. "HZXM_#08-01.wav" matches both "F:/test/Audio/HZXM_#001.wav" and "F:/test/Audio/HZXM_#08
8801
#wav".
Either set string.find's third parameter ("plain") to true to disable pattern matching or escape the metacharacters.
Code:
result = ("F:/test/Audio/HZXM_#08-01.wav"):find("HZXM_#08-01.wav", 1, true)
result = ("F:/test/Audio/HZXM_#08-01.wav"):find("HZXM_#08%-01%.wav")
string.find documentation:
https://www.lua.org/manual/5.3/manua...df-string.find
More about Lua patterns:
https://www.lua.org/manual/5.3/manual.html#6.4.1