0
A
回答
0
regexp03.vbs:
Dim objRegExp : Set objRegExp = CreateObject("VBScript.RegExp")
objRegExp.Global = True
Dim input
input = "I have a webpage full of numbers like: xxxx.xxx.xxx.xxx[space]xx E.g.: 124.240.187.79 82 How do I search and get them programatically?"
Dim Pattern : Pattern = "[0-9]{3}\.[0-9]{3}\.[0-9]{3}\.[0-9]{2}\s[0-9]{2}"
WScript.Echo "Pattern : " & Pattern
objRegExp.Pattern = Pattern
Set objMatches = objRegExp.Execute(input)
For i=0 To objMatches.Count-1
Set objMatch = objMatches.Item(i)
WScript.Echo objMatch.Value
Next
命令行:
cscript //nologo regexp03.vbs
輸出:
Pattern : [0-9]{3}\.[0-9]{3}\.[0-9]{3}\.[0-9]{2}\s[0-9]{2}
124.240.187.79 82
+0
這是一個vb6代碼? – user2023328 2013-02-08 22:58:18
+0
WSH,vbscript ... – STTR 2013-02-08 23:01:07
+0
好吧,我需要vb.net所以...謝謝,但它不是好東西 – user2023328 2013-02-08 23:32:19
相關問題
- 1. AWS Kibana使用特殊符號搜索
- 2. 搜索結果中的特殊符號
- 3. 獲得彈性的搜索查詢無效號碼特殊
- 4. 在mysql中使用特殊符號行搜索時無特殊符號?
- 5. MySQL按特殊ID搜索
- 6. 按特殊字符搜索
- 7. 來自php的特殊字符/統一碼/特殊符號word
- 8. 搜索號碼
- 9. 在索爾中搜索特殊字符
- 10. MYSQL搜索一個字符串是否包含特殊字符?
- 11. 如何搜索特殊字符(+ \!?),並在Lucene的一個文本
- 12. 用Zend搜索索引和搜索特殊字符Lucene
- 13. 使用CONTAINS搜索帶有「&」符號的特殊字符
- 14. 在vb.net中搜索一個方括號字符串
- 15. 從SQL Server 2008搜索特殊字符?
- 16. 用elasticsearch中的特殊字符搜索
- 17. 用特殊字符搜索C++ std :: string
- 18. 在彈性搜索特殊字符
- 19. 的Python:搜索包含特殊字符
- 20. SQL Server T-SQL搜索特殊字符
- 21. Python3 IMAP搜索特殊字符
- 22. 使用grepl搜索特殊字符?
- 23. 搜索特殊的序言謂詞
- 24. SQLite FTS4用特殊字符搜索
- 25. 有emacs的搜索特殊結紮
- 26. Prefere搜索結果在特殊國家
- 27. PostgreSQL中搜索中的特殊字符
- 28. 搜索文本中的特殊字符
- 29. mysql全文搜索和特殊字符
- 30. 帶特殊字符的php mysql搜索
使用正則表達式。 – 2013-02-08 22:39:29
喜歡?這就是爲什麼我發佈這個問題的原因 – user2023328 2013-02-08 22:43:43
我們不只是爲你做所有的想法。 [你自己試過什麼?](http://whathaveyoutried.com) – 2013-02-08 22:44:48