RegexExpand

Extract the strings matched to the patterns by doing backslash substitution on the template string. This transformer allow to input multiple regex patterns and multiple match targets, and those can be given in the input value and the argument parameters.

python · Filters And Transformers

Details

IDRegexExpand
Languagepython
From Version6.5.0
Docker Imagedemisto/python3:3.12.13.10404775
Tagstransformer string entirelist

README

Extract the strings matched to the patterns by doing backslash substitution on the template string.
This transformer allow to specify multiple regex patterns and multiple match targets, and those can be given in the input value and the argument parameters.

Script Data


Name Description
Script Type python3
Tags transformer, string, entirelist

Inputs


Argument Name Description
value List of regex or text for the pattern match.
regex A regex pattern to search (in Python).
text A match target text.
template The template text that will be returned for the output by doing backslash substitution to the patterns matched.
template_type The data type of the template.
value_takes Which type of value takes from the value argument, ‘text’ (match target) or ‘regex’.
flags The comma separated flags for pattern matching in regex. “dotall” (s), “multiline” (m), “ignorecase” (i) and “unicode” (u) are supported.
search_limit The maximum limit for scanning patterns. (0 means unlimited)

Outputs


There are no outputs for this script.

commonfields:
  id: RegexExpand
  version: -1
name: RegexExpand
script: ''
type: python
tags:
- transformer
- string
- entirelist
comment: |-
  Extract the strings matched to the patterns by doing backslash substitution on the template string.
  This transformer allow to input multiple regex patterns and multiple match targets, and those can be given in the input value and the argument parameters.
enabled: true
args:
- name: value
  description: List of regex or text for the pattern match.
  isArray: true
- name: regex
  description: A regex pattern to search (in Python).
- name: text
  description: A match target text.
- name: template
  description: The template text that will be returned for the output by doing backslash substitution to the patterns matched.
- name: template_type
  auto: PREDEFINED
  predefined:
  - text
  - json
  - list
  description: The data type of the template.
  defaultValue: text
- name: value_takes
  auto: PREDEFINED
  predefined:
  - text
  - regex
  description: Which type of value takes from the value argument, 'text' (match target) or 'regex'.
  defaultValue: text
- name: flags
  description: The comma separated flags for pattern matching in regex. "dotall" (s), "multiline" (m), "ignorecase" (i) and "unicode" (u) are supported.
- name: search_limit
  description: The maximum limit for scanning patterns. (0 means unlimited).
  defaultValue: "0"
scripttarget: 0
subtype: python3
dockerimage: demisto/python3:3.12.13.10404775
runas: DBotWeakRole
fromversion: 6.5.0
isllm: false
tests:
- No tests (auto formatted)