国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
vb中使用正則表達(dá)式
步示例
1. 啟動(dòng) Microsoft Visual Basic 6.0。
2. 在“文件”菜單上,單擊“新建項(xiàng)目”。
3. 在“新建項(xiàng)目”對(duì)話框中,單擊“Standard Exe”,然后單擊“確定”。

默認(rèn)情況下將創(chuàng)建 Form1。
4. 在“項(xiàng)目”菜單上單擊“引用”。
5. 雙擊“Microsoft VBScript Regular Expressions 5.5”,然后單擊“確定”。
6. 在工具箱中,雙擊“命令按鈕”。

默認(rèn)情況下,“Command1”將添加到窗體中。
7. 雙擊“Command1”以打開代碼窗口。
8. 將下面的代碼粘貼到“Command1_Click”事件處理程序:MsgBox(TestRegExp("is.", "IS1 is2 IS3 is4"))
注意 這個(gè)示例中將對(duì)照“IS1 is2 IS3 is4”字符串檢查 is. 模式。您可以將句點(diǎn)這一特殊字符(.)用作通配符,這樣,搜索模式就能夠多匹配并多顯示一個(gè)字符。如果您在搜索模式中添加兩個(gè)句點(diǎn),您會(huì)看到兩個(gè)其他字符。如果您不使用任何句點(diǎn),您只會(huì)看到搜索模式。
9. 將以下函數(shù)添加到“Command1_click”事件處理程序后:Function TestRegExp(myPattern As String, myString As String)
   ''Create objects.
   Dim objRegExp As RegExp
   Dim objMatch As Match
   Dim colMatches   As MatchCollection
   Dim RetStr As String

   '' Create a regular expression object.
   Set objRegExp = New RegExp

   ''Set the pattern by using the Pattern property.
   objRegExp.Pattern = myPattern

   '' Set Case Insensitivity.
   objRegExp.IgnoreCase = True

   ''Set global applicability.
   objRegExp.Global = True

   ''Test whether the String can be compared.
   If (objRegExp.Test(myString) = True) Then

   ''Get the matches.
    Set colMatches = objRegExp.Execute(myString)   '' Execute search.

    For Each objMatch In colMatches   '' Iterate Matches collection.
      RetStr = RetStr & "Match found at position "
      RetStr = RetStr & objMatch.FirstIndex & ". Match Value is ''"
      RetStr = RetStr & objMatch.Value & "''." & vbCrLf
    Next
   Else
    RetStr = "String Matching Failed"
   End If
   TestRegExp = RetStr
End Function

10. 在“運(yùn)行”菜單上,單擊“啟動(dòng)”來運(yùn)行該應(yīng)用程序。
11. 單擊“Command1”。

此時(shí)將出現(xiàn)一個(gè)消息框,該消息顯示 IS1 is2 IS3 is4 字符串中的所有 is 匹配項(xiàng)。
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
賭5毛錢的,你肯定從不知道提取字符如此輕松
用正則解析圖片地址,并利用XMLHTTP組件將其保存
delphi的string類型只能容納255個(gè)字符嗎
隨機(jī)驗(yàn)證碼(二)
獲取IP等信息方法較多,不過XP與WIN7有所不同
PHP: strpos
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服