找回密码
 加入
搜索
查看: 1464|回复: 1

[AU3基础] [已解决]正则:把下面的2个替换过程用1个替换过程完成?

[复制链接]
发表于 2011-1-13 09:33:15 | 显示全部楼层 |阅读模式
本帖最后由 newuser 于 2011-1-13 13:30 编辑
Local  $Str="asdadas123asdasdas456asdasdasd789asdasd";目的是想让数字之间用 - 连接,即  1-2-3 形式
Local  $Result=StringRegExpReplace($Str,"\d","\0-")
MsgBox(0,"",$Result)
Local  $Result1=StringRegExpReplace($Result,"(\d)-(\D)","$1$2")
MsgBox(0,"",$Result1)
发表于 2011-1-13 09:39:06 | 显示全部楼层
$sText = 'asdadas123asdasdas456asdasdasd78912354asdasd'
$sRer = StringRegExpReplace($sText, '(\d)(?=\d)', '$1-')
MsgBox(0, '', $sRer)

评分

参与人数 1金钱 +20 收起 理由
3mile + 20 学习了

查看全部评分

您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 16:30 , Processed in 0.073824 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表