ansible.builtin.regex_search (v2.16.0) — filter

extract regex match from string

| "added in version" 2.0 of ansible.builtin"

Authors: unknown

Install Ansible via pip

Install with pip install ansible-core==2.16.0

Description

Search in a string to extract the part that matches the regular expression.

Inputs

    
_input:
    description: String to match against.
    required: true
    type: str

_regex:
    description: Regular expression string that defines the match.
    type: str

multiline:
    default: false
    description: Search across line endings if V(True), do not if otherwise.
    type: bool

ignorecase:
    default: false
    description: Force the search to be case insensitive if V(True), case sensitive otherwise.
    type: bool

Outputs

_value:
  description: Matched string or empty string if no match.
  type: str