Refactored the code to use a more robust regex pattern and added a default value for the extracted path.
resolv.conf.j2