本帖最后由 clintonus 于 2011-04-01 15:39:56 编辑

解决方案 »

  1.   

    '此代码由“正则测试工具 v1.1.33”自动生成,请直接调用TestReg过程
    Private Sub TestReg()
        Dim strData As String
        Dim reg As Object
        Dim matchs As Object, match As Object
        Dim s$    strData = "guaranteed整体短线索马里>, wh红线ile reaffirming(美国) its goal of developing nuclear power as a clean energy source." & vbCrLf & _
                  "Hu extends condolences to Myanmar" & vbCrLf & _
                  "Chinese Pr粗线esident Hu Jintao has delivered a message of condolences (利比亚)to his Myanmar counterpart U Thein Sein over the losses 整体阳线东部>of life and property inflicted by a strong earthquake." & vbCrLf & _
                  "UnionPay network works well: chairman" & vbCrLf & _
                  "China doe粗线sn't 整体长线us> need another interbank network for credit cards, said the board chairman of China UnionPay Co Ltd - the country's only credit card network - in re黑线sponse to an anti-monopoly request from the United States to the World Trade Organization (WTO)."    Set reg = CreateObject("vbscript.regExp")
        reg.Global = True
        reg.IgnoreCase = True
        reg.MultiLine = True
        reg.Pattern = "整体.线(.+?)>|\((.+?)\)"
        Set matchs = reg.Execute(strData)
        For Each match In matchs
            s = s & match.SubMatches(0) & match.SubMatches(1)
        Next
        MsgBox s
    End Sub