MCPcopy Create free account
hub / github.com/experdot/pointer / isValidRegex

Function isValidRegex

src/renderer/src/utils/searchUtils.ts:85–92  ·  view source on GitHub ↗
(pattern: string)

Source from the content-addressed store, hash-verified

83 * 验证正则表达式是否有效
84 */
85export function isValidRegex(pattern: string): boolean {
86 try {
87 new RegExp(pattern)
88 return true
89 } catch {
90 return false
91 }
92}

Callers 1

SearchBarFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected