473,473 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

bbcode parsing

Hi all,

Back on the bbcode parsing (again)...

Having a few problems now with nested tags - it would seem that I had
written my test string in a way that worked perfectly with the parser -
until I changed the order of the parser - then it stopped working...

I'm assuming my problem is down to things like this:

' define BOLD tags text
strPattern = "\[b\]([^\]]+)\[\/b\]"

in my pattern I have

([^\]]+)

which I believe means "match any of the characters not enclosed", as a
result when I have:

Google

I get a nice hyperlink, but with and at either end (not converted
to <b> and </b> etc)...

If I take out the above then it just wont work at all as it'll start ending
tags all over the place, does anyone have any ideas on how I can achieve
what I want to achieve? I've next to nothing online regarding ASP and
bbCode, seems mainly php...

Any info appreciated,

Regards

Rob
Jul 22 '05 #1
1 1545
"Rob Meade" wrote in message
news:wO******************@text.news.blueyonder.co. uk...
: Back on the bbcode parsing (again)...
:
: Having a few problems now with nested tags - it would seem that I had
: written my test string in a way that worked perfectly with the parser -
: until I changed the order of the parser - then it stopped working...
:
: I'm assuming my problem is down to things like this:
:
: ' define BOLD tags text
: strPattern = "\[b\]([^\]]+)\[\/b\]"
:
: in my pattern I have
:
: ([^\]]+)
:
: which I believe means "match any of the characters not enclosed", as a
: result when I have:
:
: Google
:
: I get a nice hyperlink, but with and at either end (not converted
: to <b> and </b> etc)...
:
: If I take out the above then it just wont work at all as it'll start
ending
: tags all over the place, does anyone have any ideas on how I can achieve
: what I want to achieve? I've next to nothing online regarding ASP and
: bbCode, seems mainly php...

How about this:
\[b\](.+)\[\/b\]

For bold, colors, etc, you could just use this:

if instr(1, str, "") then
str = replace(str, "","<span style=""font-weight: bold"">")
end if
if instr(1, str, "
") then
str = replace(str, "
","</span>")
end if

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dave Moore | last post by:
Hi All, I'd like enable visitors to my website to use bbcode and emoticons whilst entering text into a form. Are there any standard lumps of php/javascript I can use for this purpose?. In...
1
by: 如履薄冰 | last post by:
BBcode reference: http://www.phpbb.com/phpBB/faq.php?mode=bbcode I want write a BBcode module in Python, but I'v not idea for this. Who can tell me about this arithmetic? ( I'm so sorry for my...
6
by: Thaqalainnaqvi | last post by:
IPB WARNING mysql_query() : Unable to save result set (Line: 457 of /ips_kernel/class_db_mysql.php) There appears to be an error with the database. You can try to refresh the page by clicking...
0
by: Will McGugan | last post by:
Hi, I have written a BBCode parsing module that may be of use to some people. It turns BBCode in to XHTML snippets. See the following page if you are interested... ...
8
by: Matthias S. | last post by:
hi there, i'm desperately looking for an HTML to BBCode (and vice versa) converter, either as a COM component or vbScript for use in an ASP (not .NET) web-application. i sure could write one on...
1
by: Toni | last post by:
Where can I find BBCode editor (editor for forums and blogs) for ASP.NET. I need editor like FreeTextBox (but BBCode, not HTML like FreeTextBox). I need source code or control. Where can I find it?...
3
by: codemannh | last post by:
I have been trying to figure out the best way to parse some chunks of html code that contain tables. I've been trying to do this with HTML::Parser and HTML::TokeParser and HTML::TokeParser::Simple,...
8
by: raaman rai | last post by:
i am adding dynamic contents in my website. So i also want to have a news or announcements to be dynamically displayed. But for this i need to use BBCode. But in reference to this, i dont know how...
2
by: bgold12 | last post by:
I already posted this message, but it didn't work or something. So if this is a duplicate, ignore it. I just can't figure out how to install this extension. From what I understand, there needs...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.