Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: 查找替换中使用正则表达式后替换不正确 https://github.com/siyuan-note/siyuan/issues/6722

Liang Ding934ea789a001
diff --git a/kernel/model/search.go b/kernel/model/search.go
index 3da69d6146..3eec57acbf 100644
--- a/kernel/model/search.go
+++ b/kernel/model/search.go
@@ -543,6 +543,7 @@ func fullTextSearch(query, box, path, typeFilter string, beforeLen int, querySyn
func fullTextSearchByRegexp(exp, box, path, typeFilter string, beforeLen int) (ret []*Block, matchedBlockCount, matchedRootCount int) {
exp = gulu.Str.RemoveInvisible(exp)
+ exp = regexp.QuoteMeta(exp)
fieldFilter := fieldRegexp(exp)
stmt := "SELECT * FROM `blocks` WHERE (" + fieldFilter + ") AND type IN " + typeFilter