Courseiva

EX294 Transform data with filters and plugins Practice Question

Which TWO filters are commonly used to transform strings in Ansible? (Select exactly two.)

⚠ Common exam trap

Candidates often confuse filters that manipulate data structures (like `items2dict`, `flatten`, `dict2items`) with filters that transform strings, leading them to select options that are valid Ansible filters but not applicable to string transformation.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

regex_replace

`regex_replace` is a built-in Jinja2 filter in Ansible that allows you to transform strings by replacing substrings that match a regular expression pattern. This is commonly used for string manipulation tasks such as sanitizing user input or formatting output.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    regex_replace

    Why this is correct

    regex_replace substitutes regex patterns.

  • ✗

    items2dict

    Why it's wrong here

    items2dict converts a list of pairs to a dict.

  • ✗

    flatten

    Why it's wrong here

    flatten is for lists, not strings.

  • ✓

    trim

    Why this is correct

    trim removes whitespace from string ends.

  • ✗

    dict2items

    Why it's wrong here

    dict2items converts a dict to a list of key-value pairs.

About these practice questions

This EX294 question is part of Courseiva's 392-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This EX294 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX294 exam.