>> > im sorry, htmleditformat()?  why would I need that
>> > again?
>>
>> To make sure that if the query has a > or < in it that
>> those
>> characters are converted to html entities before they're
>> displayed...
>> otherwise, a query like this:
>>
>>   select * from table where x < #x# and y > #y#
>>
>> will display in the browser like this:
>>
>>   select * from table where x #y#
>
> im displaying a pre and this is only for sql code right
> now so that shouldnt be a problem, but ill definately
> keep that in mind.

Umm... if you're using an html page to display syntax-highlighted SQL,
then ... I would think it should be an issue... unless you never run
into a situation where you need to display a SQL query with a > or <
for numeric comparison, which is pretty common... for example: "select
* from products where price < #searchprice# " -- if that statement
isn't htmleditformat()ed before you apply the syntax highlighting, the
< will potentially ruin the display when it goes to the browser.

> by the way, I did get the parenthesis to work:

> <cfset out = REreplace(out, "(\([^']*\))", "<strong
> class=""paren"">\1</strong>", "all") />

That's still not quite right tho... if you use this prior to the
regex, you might see why:

<cfset out = "select * from table where x in ('a','b','c')">

The above regex will not match the in clause because the negated class
[^'] will stop before the first instance of a single quote... replace
that single quote with a ) and you should be fine.


s. isaac dealey     954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218914
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to