sublime text 正则替换为分组内容

sublime text 正则替换为分组内容

进行文本替换

and ro.reason=d.id
— {and ro.createtime>=:createStartDate}
— {and ro.createtime<DATE_ADD(:createEndDate,INTERVAL 1 DAY)}
— {and ro.refundtime>=:refundStartDate}
— {and ro.refundtime<DATE_ADD(:refundEndDate,INTERVAL 1 DAY)}

 

使用正则替换:

正则: –\s\{(.*?)\}
替换值:\1  (替换为分组获取的一组数据)

替换后的文本:

and ro.reason=d.id
and ro.createtime>=:createStartDate
and ro.createtime<DATE_ADD(:createEndDate,INTERVAL 1 DAY)
and ro.refundtime>=:refundStartDate
and ro.refundtime<DATE_ADD(:refundEndDate,INTERVAL 1 DAY)

 

 

sublime text 正则替换为分组内容》有2条留言

留下回复