Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/CatMuse/HiNote
/ escapeRegExp
Method
escapeRegExp
src/utils/HighlightRegexUtils.ts:9–11 ·
view source on GitHub ↗
* 转义正则表达式中的特殊字符
(string: string)
Source
from the content-addressed store, hash-verified
7
* 转义正则表达式中的特殊字符
8
*/
9
static escapeRegExp(string: string): string {
10
return
string.replace(/[.*+?^${}()|[\]\\]/g,
'\\$&'
);
11
}
12
13
/**
14
* 移除文本中的高亮格式,保留纯文本
Callers
2
removeHighlightFormat
Method · 0.95
getCommonHighlightPatterns
Method · 0.95
Calls
1
replace
Method · 0.80
Tested by
no test coverage detected