7,785
社区成员




Private Sub Command1_Click()
Dim jsstr
jsstr = "<SCRIPT language=JavaScript>" & vbCrLf & _
"var j,u,p,r,w,s" & vbCrLf & _
"j='""=dhf""thfgh564""ghdf==""'" & vbCrLf & _
"u= true" & vbCrLf & _
"p = 1.8766-e23;" & vbCrLf & _
"r =""$^$%^$%55===^$%""" & vbCrLf & _
"w= null" & vbCrLf & _
"s =543" & vbCrLf & _
"</script>"
RichTextBox1.Text = jsstr
GetValue (RichTextBox1.Text)
End Sub
Function GetValue(mStr) As Boolean
Dim re
Dim oMatches
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.MultiLine = True
re.Pattern = "\s[juprws]\s*=\s*([""']?)(.+?)(\1)(?=(\s|;))"
Set oMatches = re.Execute(mStr)
If oMatches.Count > 0 Then
GetValue = True
For Each matche In oMatches
MsgBox matche.SubMatches(1)
Next
Else
GetValue = False
End If
End Function
Private Sub Command1_Click()
MsgBox getURL(WebBrowser1.LocationURL)
End Sub
Function getURL(sURL)
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = "^((http|https|ftp):\/\/[^\/?]+(.(?=(($)|(\/))))(\/([^?]+\/)*)?)"
Set oMatches = re.Execute(sURL)
If oMatches.Count > 0 Then getURL = oMatches(0)
End Function