Local $Str = _
'http://www.xx.com/id?=01' & @CRLF & _
'http://www.xx.com/id?=01' & @CRLF & _
'http://www.xx.com/id?=02' & @CRLF & _
'http://www.xx.com/id?=03 ' & @CRLF & _
'http://www.xx.com/id?=01 ' & @CRLF & _
'http://www.xx.com/id?=02' & @CRLF & _
'http://www.xx.com/id?=05' & @CRLF & _
'http://www.xx.com/id?=04' & @CRLF & _
'http://www.xx.com/id?=01 1' & @CRLF & _
'http://www.xx.com/id?=08' & @CRLF & _
'http://www.xx.com/id?=05 '
MsgBox(0, '原字符串', $Str)
Local $sRE = StringRegExpReplace($str, '(?m)(^\V+)(?:\s*\v+)(?=[^\1]*\1\s*(?=\v|$))', '')
MsgBox(0, '替换结果', $sRE)
|