June 27th, 2003, 11:58 AM
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"
Set Matches = RExp.execute(gw)
For Each Match in Matches
Response.write "Text " & match.value & " found at position " & match.firstIndex & "<br>"
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?
June 27th, 2003, 01:12 PM
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.
June 27th, 2003, 01:19 PM
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
June 27th, 2003, 01:30 PM
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.