#1
  1. No Profile Picture
    Average Intelligence
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2003
    Location
    Ohio/Chicago
    Posts
    678
    Rep Power
    12

    RegExp


    When using the RegExp object

    when I do an execute, and it returns no matches, how do i test to see if it had no matches or not? Example

    set RExp = new RegExp
    gw = "4:00 -6"
    RExp.Pattern="h"
    Set Matches = RExp.execute(gw)
    For Each Match in Matches
    Response.write "Text " & match.value & " found at position " & match.firstIndex & "<br>"
    next

    This won't print anything, now how do i check to see if it didn't, so i can print so? I'd rather not use test, i'm sure there's a way to check to see if it's value is -1 or something but i can't quit seem to figure it out, anyone know?
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    793
    Please use an appropriate subject title. You can read the sticky thread at the top of this forum for more information on how to post a question.
  4. #3
  5. No Profile Picture
    Average Intelligence
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2003
    Location
    Ohio/Chicago
    Posts
    678
    Rep Power
    12
    I've viewed it, i figured since it was a general RegExp usage question and no posts of Regular Expression or RegExp have been done before, it was a suitable name, sorry, i'll be more descriptive next time, but hey, at least it's better than "i need help" or "vb problem". And the more specific the name gets it seems it gets less and less views, no one wants to help these days....
    PS. If it were up to me, i'd change the name of the forum to Onslaught's Help Desk
  6. #4
  7. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    793
    lol
    although your title was close, one word titles just aren't descriptive enough.

    As far as the amount of help this forum gets, it is relatively new and there seems to be more people requesting help than there are who can help. I, myself, have not used the regular expression object in vb or I would have also responded with an answer for you.

IMN logo majestic logo threadwatch logo seochat tools logo