Would require a single ansible regex for below three outputs:
input1: aa::bb::cc
output1: aa::cc
input2: bb::aa::cc
output2: aa::cc
input3: aa::cc::bb
output3: aa::cc
I have written the below reg exp. But the extra double colons are still there.
example:
{{ aa::bb::cc | regexx_replace('bb') }} --> gives output as: aa::::cc
ansible localhost -m debug -a msg="{{ 'aa::bb::cc'.split('::') | difference(['bb']) | join('::') }}". Also note that this can work with any number of elements to remove.aa::bb::ccas a variable. b) it isregex_replace(you haveregexx_replace).