Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/experdot/pointer
/ escapeRegExp
Function
escapeRegExp
src/renderer/src/utils/searchUtils.ts:19–21 ·
view source on GitHub ↗
* 转义正则表达式特殊字符
(str: string)
Source
from the content-addressed store, hash-verified
17
* 转义正则表达式特殊字符
18
*/
19
function
escapeRegExp(str: string): string {
20
return
str.replace(/[.*+?^${}()|[\]\\]/g,
'\\$&'
)
21
}
22
23
/**
24
* 根据搜索选项创建正则表达式
Callers
1
createSearchPattern
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected