CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    3,332

    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!


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: regular expressions in VB 6 - finally!

    Cool...!! Nice find.
    It is not allowing me to rate it - says "You have already rated this post!!".. though it is/was first time.. so i am saying it explicitely

    RK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured