VB: 一个正则提取功能
'引用:Microfoft VBScript Regular Expressions 5.5 '一个正则提取功能
Public Function regGetStr_three(ByVal myString As String, ByVal patReg As String) As String()
Dim objRegExp As RegExp
Dim objMatch As Match
Dim colMatches As MatchCollection
Dim RetStr As String
Dim y() As String, j As Integer
ReDim y(0)
Set objRegExp = New RegExp
' objRegExp.Pattern = "a\[\d{1,3}\]=""?(.{1,})""?\.split"
objRegExp.Pattern = patReg
objRegExp.IgnoreCase = True
objRegExp.Global = True j = -1
If (objRegExp.Test(myString) = True) Then
Set colMatches = objRegExp.Execute(myString)
For Each objMatch In colMatches
j = j + 1
ReDim Preserve y(j)
y(j) = objMatch.SubMatches(0) + "," + objMatch.SubMatches(1) + "," + objMatch.SubMatches(2)
Next
Else
RetStr = "String Matching Failed"
End If
regGetStr_three = y End Function
相关文档:
'创建数据库
Private Sub Create(ByVal mdbPath As String)
If File.Exists(mdbPath) Then
Throw New Exception("目标数据库已经存在,无法创建")
......
写了一个vb的程序,用来把原来写的几个vb和vc的程序整合起来。就是使用Shell函数。结果发现,vc的程序可以很好的显示,但vb写的却一运行就最小化了。仔细查看了一下以下文章,才发现原来shell函数的默认显示模式是windowstyle是等于vbMinimizedFocus。然后就是直接加上一个vbNormalFocus。一切ok!
vb的s ......
简单
在Global.asa文件中加入如下的代码:
Java代码
1. <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
2.
3. Sub Application_OnStart
4.
5. '当服务器开启时,设置在线用户计数器为0
6. Application("ActiveUsers") = 0
7.
......
Option Explicit
Public Function ascii2Char(strInput As String) As String
Dim i As Integer
Dim strTemp As String
Dim nPos As Integer
Dim nValue As Integer
i = 1
nPos = InStr(i, strInput, "&#", vbTextCompare)
While (nPos > 0)
ascii2Char = ascii2Char + Left(st ......