|
@@ -762,8 +762,10 @@ func (s *Script) LoadScript(site *string, code, script_file string, newstate boo
|
|
|
s.L.SetGlobal("stringFind", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
regstr := S.ToString(-1)
|
|
|
text := S.ToString(-2)
|
|
|
- reg := regexp.MustCompile(regstr)
|
|
|
- result := reg.FindString(text)
|
|
|
+ textReg := regexp.MustCompile(regstr)
|
|
|
+ spaceReg := regexp.MustCompile("[\\s\u3000\u2003\u00a0]+")
|
|
|
+ text = spaceReg.ReplaceAllString(text, "")
|
|
|
+ result := textReg.FindString(text)
|
|
|
isMatch := false
|
|
|
if result != "" {
|
|
|
isMatch = true
|