Skip to content

Add regex search method

Hi!

This PR includes the ported "regex_search" method from the ansible sourcecode to ci-fairy.

My usecase is that i have data and i want to extract regex groups from that data into the template because i cannot change the source data. Currently i use the "re" module with ci_fairy.import_module. It works like that but i was encouraged to try and find another way.

Original code: https://github.com/ansible/ansible/blob/e2450d4886c43528ee8a870cc23cac73afdc6144/lib/ansible/plugins/filter/core.py#L151

I took inspiration and then wrote my own code using a sorta blackbox approach

TODO:

  • "Porting"
  • Tests written
  • Documentation written
Edited by Aconitum Napellus

Merge request reports

Loading