Hi Alex,
In that case you'll need something like:
Code:
<tag>((?:[^<]*|<(?:[^t]|t[^a]|ta[^g]|tag[^\s>]+)[^>]*>)*)</tag>
Bit of a pain to construct for different tags though, so the following function should be of use...
Code:
function GetTagExp(pTagName){
var temp = "<" + pTagName + ">((?:[^<]*|<(?:";
for(var i = 0; i < pTagName.length; i++){
temp += pTagName.substr(0, i);
temp += "[^" + pTagName.charAt(i) + "]|";
}
temp += pTagName + "[^\\s>]+)[^>]*>)*)";
temp += "</" + pTagName + ">";
return temp;
}
HTH,
Chris