Still fighting that thing, eh? I spent 3 hours this afternoon trying
to figure out why a simple INSERT query wouldn't work... finally I
wrapped the query text in ## and a cfoutput, then copy/pasted it into
Query Analyzer... only to find out that the problem was a new column
in the database that was marked not nullable. I hadn't updated the
insert to account for the new column.

DANG, I hate when that happens.

But, my my thought is this...

Why not convert every single HR or BR tag to <hr>, then run rereplace
with a regex that finds  [\[code\].<hr>.\[\/code\]] and converts <hr>
back to [HR]. Granted, it may not be the utmost in elegance (which is
never pleasing), but it would work.

Just a thought... I'll keep thinking on it too. Hard as that whole
"thinking" thing may be.

Laterz,
J



On Sun, 16 Jan 2005 19:11:27 -0500, Ewok <[EMAIL PROTECTED]> wrote:
> Incase you haven't realized.... regex's aren't my forte!
> 
> This seems to be the last little kink to get out of this thing and it will
> be set (or I'm going back to the original Jim Davis loop!)
> 
> str = rereplace(str, "(\[hr\])(?!(?!\[code\]).*?\[/code\])", "<hr>", "ALL");
> 
> this regex works perfectly as long as the string doesn't contain
> [code][\code] blocks and doesn't have any single tags BEFORE the code (like
> [hr])
> 
> if there are code blocks then the above regex will only replace [hr] with
> <hr> AFTER the [code][/code] tags and leave any [hr]'s that come before it
> unchanged
> 
> it doesn't replace the [hr]'s that fall inside the [code][/code] blocks
> either but that's what it's supposed to do, so apparently what it equates to
> is...
> 
> replace [hr] if its after the last [/code] tag found
> 
> and it should be...
> 
> replace [hr] unless its after any [code] tag AND before the NEXT [/code] tag
> 
> this block ...
> 
> [hr]
> [code][b]some code[/b][/code]
> [hr]
> [code][b]some code[/b][/code]
> [hr]
> 
> Is transformed into...
> 
> [hr]
> <pre>[b]some code[/b]</pre>
> [hr]
> <pre>[b]some code[/b]</pre>
> <hr>
> 
> The first 2 [hr] tags should be <hr> everything else works fine.
> 
> just when I thought that I was actually getting better at regular
> expressions... sigh
> 
> That is just the regex for tags without closing tags. The other regex for
> tags that have open and close works great like [b][/b]
> 
> str = rereplace(str,
> "(\[b\]([Aa-zZ0-9\s]*)\[/b\])(?!((?!\[code\]).)*?\[/code\])", "<b>\2</b>",
> "ALL");
> 
> cf-talk... Pimp my regex! Sorry... couldn't resist :)
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 1/16/2005


-- 
Continuum Media Group LLC
Burnsville, MN 55337
http://www.web-relevant.com
http://cfobjective.blogspot.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190657
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