|
-
October 28th, 1999, 03:53 AM
#1
regular expressions in VB 6 - finally!
Folks, this needs some advertising. IE 5 comes with a COM component (microsoft VBScript regular expressions) that allows you to use regular expressions in VB!
I have been dealing with workarounds for this missing feature in VB since version 3.
how to use it
private Sub Command1_Click()
Dim r as new RegExp
r.Pattern = "\([0-9]{3}\)[0-9]+"
MsgBox r.Test(Text1.Text) ' pops up true or false
End Sub
this code checks text1 for a valid American phone number, e.g. (513)1234 (if that's the correct format).
This opens up a whole new bunch of cool tricks for input validation!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|