Local $Str = _
'If Not IsDeclared("ERROR_NO_MORE_ITEMS") Then Global Const $ERROR_NO_MORE_ITEMS = 259' & @CRLF & _
' wwwwwwwwwwwwwww' & @CRLF & _
'wwww' & @CRLF & _
' If Not IsDeclared("ERROR_NO_MORE_ITEMS") Then Global Const $ERROR_NO_MORE_ITEMS = 259' & @CRLF & _
' If Not IsDeclared("ERROR_NO_MORE_ITEMS") Then Global Const $ERROR_NO_MORE_ITEMS = 259' & @CRLF & _
' deeeeee' & @CRLF & _
'If Not IsDeclared("ERROR_NO_MORE_ITEMS") Then Global Const $ERROR_NO_MORE_ITEMS = 259'
MsgBox(0, '原字符串', $Str)
Local $Test = StringRegExpReplace($str, '(?mi)^\s*if.+Then\s*(.+)', '\1')
MsgBox(0, '替换结果', $Test)
|