跳到主要内容

get_cached_regexp()

function get_cached_regexp(pattern, flags?): RegExp;

Defined in: packages/rxdb-adapter-sqlite-core/src/sqlite-client.utils.ts:96

带 LRU-ish 缓存的 RegExp 工厂,供 SQLite regexp / regexp_replace 自定义函数复用。

缓存容量超过 128 时整体清空(简单防内存暴涨),pattern 超 1000 字符直接抛错防 ReDoS。

Parameters

ParameterTypeDefault valueDescription
patternstringundefined正则表达式源串
flagsstring''正则标志,默认空串

Returns

RegExp

缓存的 RegExp 实例

Throws

当 pattern 长度超过 1000