kefu/tools/regex_test.go

13 lines
302 B
Go
Raw Permalink Normal View History

2024-12-10 02:50:12 +00:00
package tools
import (
"log"
"testing"
)
func TestReplaceStringByRegex(t *testing.T) {
orgStr := `<p>直接点击<a href="https://www.yidaoerp.cn/user/login" target="_blank">立即注册</a>登陆使用</p>`
dstStr, err := ReplaceStringByRegex(orgStr, "<[^a>]+>", "")
log.Println(dstStr, err)
}