[已解决]正则:把下面的2个替换过程用1个替换过程完成?
本帖最后由 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) $sText = 'asdadas123asdasdas456asdasdasd78912354asdasd'
$sRer = StringRegExpReplace($sText, '(\d)(?=\d)', '$1-')
MsgBox(0, '', $sRer)
页:
[1]