;做正则替换题 by easefull
Local $sText = _
'2011-05-17 02:56:23 192.168.0.1 MDDCKDDAHLBAJIGHONEGJJBH htp://192.168.0.254/' & @CRLF & _
'2011-05-17 02:56:25 192.168.0.1 MDDCKDDAHLBAJIGHONEGJJBH htp://192.168.0.254/' & @CRLF & _
'2011-05-17 02:56:28 192.168.0.1 MDDCKDDAHLBAJIGHONEGJJBH htp://192.168.0.254/' & @CRLF & _
'2011-05-17 02:56:28 192.168.0.1 MDDCKDDAHLBAJIGHONEGJJBH htp://192.168.0.254/' & @CRLF & _
'2011-05-17 02:56:28 192.168.0.1 MDDCKDDAHLBAJIGHONEGJJBH htp://192.168.0.254/xxpt/ShowArticle.asp?ArticleID=25512' & @CRLF & _
'2011-05-17 02:57:06 192.168.0.2 KADCKDDAKPNMGJMIIDCKFEJF htp://192.168.0.254/' & @CRLF & _
'2011-05-17 02:57:06 192.168.0.2 KADCKDDAKPNMGJMIIDCKFEJF htp://192.168.0.254/xxjj/ShowClass.asp?ClassID=262' & @CRLF & _
'2011-05-17 02:57:07 192.168.0.2 KADCKDDAKPNMGJMIIDCKFEJF htp://192.168.0.254/xxjj/ShowClass.asp?ClassID=262' & @CRLF & _
'2011-05-17 02:57:29 192.168.0.2 KADCKDDAKPNMGJMIIDCKFEJF htp://192.168.0.254/xxjj/ShowClass.asp?ClassID=262&page=2' & @CRLF & _
'2011-05-17 02:58:23 192.168.0.1 PEDCKDDANGAGMGACEGBCBCFC htp://192.168.0.254/' & @CRLF & _
'2011-05-17 02:58:24 192.168.0.1 PEDCKDDANGAGMGACEGBCBCFC htp://192.168.0.254/'
$sText &= @CRLF
Do
$sText = StringRegExpReplace($sText, '(\S+\s+\S+\s+)(.*?\r\n)(\S+\s+\S+\s+\2)', '\1\2')
Until Not StringRegExp($sText, '(\S+\s+\S+\s+)(.*?\r\n)(\S+\s+\S+\s+\2)', 0)
$sText = StringRegExpReplace($sText, '\r\n$', '')
ClipPut($sText)
MsgBox(0, '替换结果', $sText)
|