ansible.builtin.regex (v2.16.5) — test

Does string match regular expression from the start

Authors: Ansible Core

Install Ansible via pip

Install with pip install ansible-core==2.16.5

Description

Compare string against regular expression using Python's match or search functions.

Inputs

    
_input:
    description: String to match.
    required: true
    type: string

pattern:
    description: Regex to match against.
    required: true
    type: string

multiline:
    default: false
    description: Match against multiple lines in string.
    type: boolean

ignorecase:
    default: false
    description: Use case insenstive matching.
    type: boolean

match_type:
    choices:
    - match
    - search
    default: search
    description: Decide which function to be used to do the matching.
    type: string

Outputs

_value:
  description: Returns V(True) if there is a match, V(False) otherwise.
  type: boolean