我正在写一部剧本,以替换三个文件中的字符串。该字符串可以小写或大写。这是我的代码:
---
- name: "Modif string"
hosts: myhosts
tasks:
- name: "Replace line"
replace:
path: ~/Documents/{{ item }}
regexp: 'test'
replace: 'new'
with_items:
- 'file'
- 'file1'
- 'file2'
我如何使其起作用,以便对字符串“ test”进行修改(无论是小写还是大写)?如果该字符串中随机存在字母大写或小写怎么办?
谢谢大家。