文件名 正则表达式提取方法(2)


Call InsertDataToArray(Matches(i).SubMatches(1),aryMatch)
Next

For i=0 to Ubound(aryMatch)
If Not IsNull(aryMatch(i)) And Trim(aryMatch(i))<>"" Then Response.write aryMatch(i)&"<br>"
Next

Function InsertDataToArray(Data,ByRef aryMatch)
If Trim(Data)<>"" Then
Data=Replace(Data,"'","")
Data=Replace(Data,"""","")
Redim Preserve aryMatch(Ubound(aryMatch)+1)
ZC_UPLOAD_MATCH=False
For j=0 to Ubound(aryMatch)
If aryMatch(j)=Data Then ZC_UPLOAD_MATCH=True
Next
If Not ZC_UPLOAD_MATCH Then aryMatch(Ubound(aryMatch))=Data
End If
End Function

PS:最近正则又精进不少...

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2621.html