G
Giles
My (VB/ASP) site parses pseudocode created by authors. For example, the
author's HTML might contain
[start small padded box] This content displays in a box [end small padded
box]
The bits in square brackets are then replaced with appropriate HTML to
create a border around the text.
PageHTML=replace(PageHTML,"[start small padded box]","<div
style='width:200px; padding:4px; border:1px solid #000'>")
PageHTML=replace(PageHTML,"[end small padded box]","</div>")
The problem is, the spaces might (or might not) be due to the
authoring interface
[start small padded box] This content displays in a box [end small
padded box]
Is there a regular expression that can turn (if they exist) into
spaces? (Prior to applying the pseudocode conversion)
function deNBSP(s,html)
?
?
end function
PageHTML=deNBSP("[start small padded box]", PageHTML)
PageHTML=deNBSP("[end small padded box]", PageHTML)
The pseudocode phrases can be quite long, and have a lot of spaces, I was
hoping a RegExp would be quicker than looping through, using replace() for
every permutation of space - in a phrase.
Thanks if you can help, or advise a different strategy.
author's HTML might contain
[start small padded box] This content displays in a box [end small padded
box]
The bits in square brackets are then replaced with appropriate HTML to
create a border around the text.
PageHTML=replace(PageHTML,"[start small padded box]","<div
style='width:200px; padding:4px; border:1px solid #000'>")
PageHTML=replace(PageHTML,"[end small padded box]","</div>")
The problem is, the spaces might (or might not) be due to the
authoring interface
[start small padded box] This content displays in a box [end small
padded box]
Is there a regular expression that can turn (if they exist) into
spaces? (Prior to applying the pseudocode conversion)
function deNBSP(s,html)
?
?
end function
PageHTML=deNBSP("[start small padded box]", PageHTML)
PageHTML=deNBSP("[end small padded box]", PageHTML)
The pseudocode phrases can be quite long, and have a lot of spaces, I was
hoping a RegExp would be quicker than looping through, using replace() for
every permutation of space - in a phrase.
Thanks if you can help, or advise a different strategy.