How to write BBS format conversion code?

W

Welman Jordan

Hello,

I would like to write a simple forum for my site, which
enables some formating, like , , and some other
BBS format code.

For example,
the user inputs this string in a multiline textbox, as
the body of his/her post,

[a=[URL="http://www.microsoft.com"]www.microsoft.com[/URL]]Hello world[a]

The application will translate it to HTML code when his/
her post is shown up in the forum.

<a href="www.microsoft.com"><b>Hello <i>world</i></b></a>

Maybe I should use Regular Express to perform several
Replace methods on the string. But I am quite afraid of
the performance, as I were to support more and more
formatting codes besides the [a], , ...

Anybody have some opinions about how to write such kind of
format translation codes efficiently? Or where else I can
find some existing codes to begin with?

Thanks,
W. Jordan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top