PDA

View Full Version : سوال: الگو ها و regex ها در ویژوال بیسک



kamran_14
جمعه 12 خرداد 1391, 09:22 صبح
سلام
می شه در مورد این تابع توضیح بدید ممنون میشم

Function TestRegExp(myPattern As String, myString As String) 'Function baraye search link ha dar file
Dim objRegExp As RegExp
Dim objMatch As Match
Dim colMatches As MatchCollection
Dim RetStr As String
Set objRegExp = New RegExp
objRegExp.Pattern = myPattern
objRegExp.IgnoreCase = True
objRegExp.Global = True
If (objRegExp.Test(myString) = True) Then
Set colMatches = objRegExp.Execute(myString)
For Each objMatch In colMatches
RetStr = RetStr & objMatch.Value
List1.AddItem objMatch.Value
Next
Else
RetStr = "String Matching Failed"
End If
TestRegExp = RetStr
End Function