用值后跟数字替换文件中的文本
Replace text in the file with value followed by number
我尝试使用 replace 模块来替换配置文件中的端口号。一般可以这样完成:
replace: dest=config.file regexp='(.*)8080(.*)$' replace='081'
但它会导致问题,因为它试图匹配反向引用 18081。
我试过用 </code> 替换 <code>
但它不起作用。
我做到了:
replace: dest=config.file regexp='(.*)8080(.*)$' replace='\g<1>8081'
我尝试使用 replace 模块来替换配置文件中的端口号。一般可以这样完成:
replace: dest=config.file regexp='(.*)8080(.*)$' replace='081'
但它会导致问题,因为它试图匹配反向引用 18081。
我试过用 </code> 替换 <code>
但它不起作用。
我做到了:
replace: dest=config.file regexp='(.*)8080(.*)$' replace='\g<1>8081'