进行文本替换

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)

 

 

2条回应:“sublime text 正则替换为分组内容”

  1. hmpop说道:

    妹滴用baidu一搜就搜大海的大作了,不错,赞一个先

发表评论