我有如下字符串列表:
Austria: ac.at
Bangladesh: ac.bd
Belgium: ac.be
China: ac.cn
Cyprus: ac.cy
India: ac.in
我需要得到一个列表如下:
$Resolved URL$ LIKE "*ac.at/*"
$Resolved URL$ LIKE "*ac.bd/*"
$Resolved URL$ LIKE "*ac.be/*"
$Resolved URL$ LIKE "*ac.cn/*"
$Resolved URL$ LIKE "*ac.cy/*"
$Resolved URL$ LIKE "*ac.id/*"
使用正则表达式替换执行此操作的最佳方法是什么?
您可以在正则表达式模式下尝试以下查找和替换:
Find: ^.*?(\S+)$
Replace: $Resolved URL$ LIKE "*$1/*"
下面是正则表达式的解释:
^ from the start of the string
.*? consume (but do not capture) all content
(\S+) up until the final collection of non word characters and capture them
$ end of the input
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句