Hi,
I am putting together a quick (I hoped...) ASP page using VBScript to
parse some data, add some stuff up, and display it to a user.
Unfortunately, I had to whip the page together that took that data in
a big hurry and some fields were left blank. Now when I parse the
data, these empty fields are causing an error. Also, some people put
characters in where there were supposed to be numbers. Bad job on
developing the page to take the data on my part.
However, I am trying to just check to see if something is NOT a
number, and replace it with a 0. This will be fine for my needs. I
am getting zero matches on the regular expression! Forgive me, I am
not used to doing these in VBScript but have used regex in Perl and
JavaScript. I am not sure if I am just messing up or if it is a
VBScript nuance.
Set regExNum = New RegExp
regExNum.Pattern = "\D"
q1 = Split(record(fieldCount), ",")
for k=0 to UBOUND(q1)
if regExNum.Test(q1(k)) then
q1(k) = 0
end if
next
I am getting zero matches on this. For example, on particular
instance is an empty space that was not filled in and it is crashing
my select statement. I am getting a false on the comparison so the
replacement never takes place.
Thanks for any suggestions.