Search among all non-blanks in string
Posted on 2014-02-25
I attempt to make a search in records containing both blank and linebreak characters. The basic InStr("str", search) only return results from the first line in the record, not recoqnizing anything under that.
Forums point out that RegExp could rid the record of unwanted blanks, so the search string applies to all non-blanks of the InStr, but so far this method eludes me. Also I need the code to ignore case.
Applied the following code and variants, but that simply fails, returning no results whatsoever, so what do I miss?
Dim re, targetString, colMatch, objMatch
do while not McalRec.EOF
Set re = New RegExp
.Pattern = "\s"
.Global = True
.IgnoreCase = True
targetString = re.Test(McalRec("notat"))
if Instr(targetString, SearchMCal) then
countallMcal = countallMcal + 1
response.write("<tr align='left' valign=top style='color:#FF0000;'>" &_
"<td style='color:#FF0000;'>" & McalRec("notat") & "</td>" &_