这是VB代码,有兴趣的朋友可以试一下
Private Sub Command1_Click()
Dim RegEx As New RegExp
RegEx.Global = True
RegEx.IgnoreCase = True
RegEx.MultiLine = True
RegEx.Pattern = "^123456789$"
If RegEx.Test(Text1.Text) Then MsgBox "OK" Else MsgBox "False"
End Sub
Private Sub Command1_Click()
Dim RegEx As New RegExp
On Error GoTo p
RegEx.Global = True
RegEx.IgnoreCase = True
RegEx.MultiLine = True
RegEx.Pattern = "^123456789$"
RegEx = RegEx / 5
Exit Sub
p:
If RegEx.Test(Text1.Text) Then MsgBox "OK" Else MsgBox "False"
End Sub