@@ -13,6 +13,7 @@ experimental::[]
13
13
* <<eql-fn-endswith>>
14
14
* <<eql-fn-indexof>>
15
15
* <<eql-fn-length>>
16
+ * <<eql-fn-match>>
16
17
* <<eql-fn-startswith>>
17
18
* <<eql-fn-string>>
18
19
* <<eql-fn-stringcontains>>
@@ -414,6 +415,71 @@ field datatypes:
414
415
*Returns:* integer or `null`
415
416
====
416
417
418
+ [discrete]
419
+ [[eql-fn-match]]
420
+ === `match`
421
+
422
+ Returns `true` if a source string matches one or more provided regular
423
+ expressions.
424
+
425
+ [%collapsible]
426
+ ====
427
+ *Example*
428
+ [source,eql]
429
+ ----
430
+ match("explorer.exe", "[a-z]*?.exe") // returns true
431
+ match("explorer.exe", "[a-z]*?.exe", "[1-9]") // returns true
432
+ match("explorer.exe", "[1-9]") // returns false
433
+ match("explorer.exe", "") // returns false
434
+
435
+ // process.name = "explorer.exe"
436
+ match(process.name, "[a-z]*?.exe") // returns true
437
+ match(process.name, "[a-z]*?.exe", "[1-9]") // returns true
438
+ match(process.name, "[1-9]") // returns false
439
+ match(process.name, "") // returns false
440
+
441
+ // null handling
442
+ match(null, "[a-z]*?.exe") // returns null
443
+ ----
444
+
445
+ *Syntax*
446
+ [source,txt]
447
+ ----
448
+ match(<source>, <reg_exp>[, ...])
449
+ ----
450
+
451
+ *Parameters*
452
+
453
+ `<source>`::
454
+ +
455
+ --
456
+ (Required, string or `null`)
457
+ Source string. If `null`, the function returns `null`.
458
+
459
+ If using a field as the argument, this parameter supports only the following
460
+ field datatypes:
461
+
462
+ * <<keyword,`keyword`>>
463
+ * <<constant-keyword,`constant_keyword`>>
464
+ * <<text,`text`>> field with a <<keyword,`keyword`>> or
465
+ <<constant-keyword,`constant_keyword`>> sub-field
466
+ --
467
+
468
+ `<reg_exp>`::
469
+ +
470
+ --
471
+ (Required{multi-arg-ref}, string)
472
+ Regular expression used to match the source string. For supported syntax, see
473
+ <<regexp-syntax>>.
474
+ https://docs.oracle.com/javase/tutorial/essential/regex/pre_char_classes.html[Predefined
475
+ character classes] are not supported.
476
+
477
+ Fields are not supported as arguments.
478
+ --
479
+
480
+ *Returns:* boolean or `null`
481
+ ====
482
+
417
483
[discrete]
418
484
[[eql-fn-startswith]]
419
485
=== `startsWith`
0 commit comments