I have create a demo file, that you can download, and a page to see it running. What I need to have done, is that all the tags, need to be removed ONLY in the area (BBCode [code])
UPDATE: The code does not work with multiple BBCode tags. So if there is
[URL] [Site] [B]
Or anything else, the script below breaks all the tags. And will not process the page properly.
Here is the link to the demo page. http://www.cffcs.com/test/EE/Main.asp
Here is the link to the download .zip file. http://www.cffcs.com/test/EE/Request.zip
If someone can assist me with this, I will be mighty grateful.
The following code, is used, however, I found that it breaks everything else that is NOT involved in the '[code' section This is what is being used, of which can be found in the code file above.
Function ReplaceChar(strString)
strString = Reggex(strString, "\[code=(.*?)\](.*?)\[\/code\]", "<code class=""$1"">$2</code>")
ReplaceChar = strString
End Function
Function ProtectSQL(SQLString)
SQLString = SQLString
SQLString = Replace(SQLString, "'", "''") ' replace > with >
SQLString = Replace(SQLString, vblf,"<br>") ' replace vblf with <br /> (This is mainly used for Memo fields.
SQLString = Trim(SQLString)
ProtectSQL = SQLString
End Function
getText = ProtectSQL(request.form("Answers"))
bigString = ReplaceChar(getText)
'grab the left chunk of text starting to the position just after [code
startString = LEFT(bigString, INSTR(bigString, "<code ") + 6)
endString = RIGHT(bigString, LEN(bigString)-INSTR(bigString, "</code>")+1)
midString = REPLACE(bigString, endString, "")
midString = REPLACE(midString, startString, "")
midString = REPLACE(midString, "<br>",vbLf)
bigString = startString & midString & endString
and sent everything through a textarea, and wa-la, I saw all the other BBCode tags shinning through. So. That is the issue, the code does not work with BBCode tags. That is the Update
– Wayne Barron Mar 12 '15 at 05:54") + 6) or bigString, "[code=sql] ") + 10)
– Wayne Barron Mar 12 '15 at 06:43