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

replace a string via regex

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

Authors: unknown

Install Ansible via pip

Install with pip install ansible-core==2.16.0

Description

Replace a substring defined by a regular expression with another defined by another regular expression based on the first match.

Inputs

    
_input:
    description: String to match against.
    required: true
    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

_regex_match:
    description: Regular expression string that defines the match.
    required: true
    type: int

_regex_replace:
    description: Regular expression string that defines the replacement.
    required: true
    type: int

Outputs

_value:
  description: String with substitution (or original if no match).
  type: str