In article <3C027DEF.218F4875 / stud.ntnu.no>, "Kent Dahl"
<kentda / stud.ntnu.no> wrote:

> HarryO wrote:
>> So, can anyone suggest the right way to approach this?
> 
> Not the "right way", but one that I, as a I find myself using
> "pseudo-xml" in lots of posts, prefer, is that recognized legal tags are
> entered as HTML, and all other instances of < and > are replaced with
> &lt; and &gt;

That was the sort of thing I was getting at if I approached it from
the point of view of the UNacceptable tags.

> This seems somewhat easier to implement too. You could regexp on any
> occurance of /<.*>/, check if the contents are listed in the "allowed
> tags" list, and gsub the < and > if not.

If there are many tags in the string, I'd have to do the regexp matching
multiple times.  How do I avoid it simply matching the same tags over
and over again (in the case where the regexp matches an acceptable
tag, rather than an unacceptable one)?

> Of course, this is just of the top of my (quite often faulty) head.

I'll bet it's not faulty as often as mine !!