_expression_ libraries (assuming you're using a 1.4 JRE, which CFMX 6.1 ships
with), or you can skip the REs completely, and do linear text parsing. That
is, start at the beginning of the string, search until you find something to
deal with, process it, and repeat until you get to the end. Not nearly as
elegant, but it'll work. Another potential option would be do change your
RE to not have "(.*)" in the middle, but to have "([^[]*)", which won't
allow nested "tags", but that might be ok.
cheers,
barneyb
_____
From: Phil Cruz [mailto:[EMAIL PROTECTED]
Sent: Friday, February 20, 2004 10:22 AM
To: CF-RegEx
Subject: help with formatting function
I have an application where you can post comments but I don't want to allow
html. I want to allow some formatting like in forums so I want to convert
[B]this is bold[/B] to <b>this is bold</b>.
I have a udf that does
formattedString =
rereplaceNoCase(arguments.stringToFormat, "\[B\](.*)\[/B\]", "<B>\1</B>"
, "ALL");
It works but if the string is [B]this is bold[/B] and [B]this is also
bold[/B] it will convert the entire string as
<B>this is bold[/B] and [B]this is also bold</B>
rather than
<B>this is bold</B> and <B>this is also bold</B>
How can I fix this to get the desired result?
Thanks,
Phil
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
