Results 1 to 2 of 2
Oct 9, 2006, 05:45 #1
REGEXP uppercases and double quotes
I'm trying to solve three minor problems with vbscript REGEXP.
1) I want to find any occurences of and|or|not in a string and capitalize them.
regEx.Pattern = "(\s)(and|or|not)(\s)"
KW = trim(regEx.Replace(KW, "$1" & ucase("$2") & "$3"))
how come this is not working?
2) when highlighting words (in a search results page for example), I want to match the word ignoring case. however, when wrapping the word in highlighting code and replacing the substring, I want to keep the original capitalization.
regEx.Pattern = "(^|\s|[^a-z0-9])" & highlitetemp(iTemp) & "(\s|$|[^a-z0-9])"
Body = trim(regEx.Replace(Body, "$1<span class=highlite>" & highlitetemp(iTemp) & "</span>$2"))
for example, if the word to match is marvelous, but the word is stored uppercase in the db, the above code will replace the word with a lowercase version. how do I get around this?
3) I want to remove any and|or that are not inside double quotes in a string. for example,
test = """The dog and the cat""" & " and fox or mouse " & """the cat and the dog"""
resulting in "The dog and the cat" and fox or mouse "the cat and the dog"
I would like to remove only the AND OR linking fox and mouse in the middle of the string. how would I do that?
thanks in advance!!!!!
Oct 10, 2006, 06:20 #2