PatternCompiler
Defined in: core/src/detection-engine/compiler.ts:48
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PatternCompiler(
defaultTimeoutMs?,maxCacheSize?):PatternCompiler
Defined in: core/src/detection-engine/compiler.ts:53
Parameters
Section titled “Parameters”defaultTimeoutMs?
Section titled “defaultTimeoutMs?”number = 2000
maxCacheSize?
Section titled “maxCacheSize?”number = 1000
Returns
Section titled “Returns”PatternCompiler
Methods
Section titled “Methods”batchCompile()
Section titled “batchCompile()”batchCompile(
patterns,validate?):Promise<Map<string,RegExp|RE2Instance>>
Defined in: core/src/detection-engine/compiler.ts:201
Parameters
Section titled “Parameters”patterns
Section titled “patterns”string[]
validate?
Section titled “validate?”boolean = true
Returns
Section titled “Returns”Promise<Map<string, RegExp | RE2Instance>>
clearCache()
Section titled “clearCache()”clearCache():
Promise<void>
Defined in: core/src/detection-engine/compiler.ts:220
Returns
Section titled “Returns”Promise<void>
compile()
Section titled “compile()”compile(
pattern,flags?):Promise<RegExp|RE2Instance>
Defined in: core/src/detection-engine/compiler.ts:67
Parameters
Section titled “Parameters”pattern
Section titled “pattern”string
flags?
Section titled “flags?”string = 'gi'
Returns
Section titled “Returns”Promise<RegExp | RE2Instance>
compileSync()
Section titled “compileSync()”compileSync(
pattern,flags?):RegExp
Defined in: core/src/detection-engine/compiler.ts:101
Parameters
Section titled “Parameters”pattern
Section titled “pattern”string
flags?
Section titled “flags?”string = 'gi'
Returns
Section titled “Returns”RegExp
safeMatch()
Section titled “safeMatch()”safeMatch(
pattern,content,timeoutMs?):Promise<MatchResult|null>
Defined in: core/src/detection-engine/compiler.ts:105
Parameters
Section titled “Parameters”pattern
Section titled “pattern”string
content
Section titled “content”string
timeoutMs?
Section titled “timeoutMs?”number
Returns
Section titled “Returns”Promise<MatchResult | null>
validatePatternSafety()
Section titled “validatePatternSafety()”validatePatternSafety(
pattern,testStrings?): [boolean,string]
Defined in: core/src/detection-engine/compiler.ts:172
Parameters
Section titled “Parameters”pattern
Section titled “pattern”string
testStrings?
Section titled “testStrings?”string[]
Returns
Section titled “Returns”[boolean, string]