Can someone please help with an example code how to validate email string format with regex?
I have a code that doesn’t work:
vars:
emailRegExpression: “[1]+@([\w-]+\.)+[\w-]{2,4}$”
emailAddress: “myemail@domain.com”
tasks:
- name: Validating email address
set_fact:
emailTest: “{{ emailAddress | regex_search(‘[2]+@([\w-]+\.)+[\w-]{2,4}$’) }}” - debug:
var: emailTest