Just be sure to htmleditformat() the string before you perform the
regex if you're planning to use this for say web-based syntax
highlighting. :)

> Try REreplace(sql, "('[^']*')", "<strong>$1</strong>",
> "all")

> That says find an apsotrophe, followed by any number of
> non-apostrophe
> characters, and then another apostrophe and replace it
> with itself,
> surrounded by STRONG tags.

> cheers,
> barneyb

> On 9/21/05, Ryan Guill <[EMAIL PROTECTED]> wrote:
>> hey guys,
>>
>> not ever really used regex much except for really simple
>> cases.  But
>> have a question about it now.
>>
>> Lets say I have the following sql code:
>>
>> SELECT * FROM sometable WHERE this = 'this string'
>>
>> and I want to replace the single quotes AND its contents
>> with the same
>> things only surrounded by <strong> tags.  so take the
>> string above,
>> look for single quotes and make it like this:
>>
>> SELECT * FROM sometable WHERE this = <strong>'this
>> string'</strong>
>>
>> (thats not exactly what I want to do, but close enough.)
>>
>> how would you go about doing this with rereplacenocase?
>> is it even
>> possible?  all examples I see are looking for a regex
>> that can have
>> wildcards in the middle etc, but how to take what you
>> find and wrap it?


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:218847
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to