Charlie, think of my problem like this. Say you had any 5 character combos
you wanted to remove, for whatever reason.
I'm just looking for a simpler (or so I thought) RegEx way to do this.

I could loop over a list, but I thought (perhaps naively) there might be a
Regex function that could accepta a list of chars and then replace any of
them when a match was found.

-----Original Message-----
From: Charlie Griefer [mailto:[email protected]] 
Sent: Thursday, August 13, 2009 2:29 PM
To: cf-talk
Subject: Re: Regex Help - Can this be simplified?


less lines != simplified :)

A year from now, which version are you going to want to come back to when it
needs work?  The 3 line version or the 1?

I'd prefer the 3.  Easier to read.

Not really sure a regex solution is warranted here.  You could probably get
one whipped up to find all instances of the tag combinations that you
want... but not all instances are replaced with the same string.  Only the
first one (the <br>) is replaced with a single <br />.  The others are
replaced with two <br />s.

Also curious about the need to replace <p></p> with <br /><br />.  I'm not a
CSS guru, but I believe the two are semantically different.  One (the <p />)
is meant to contain text.  The other (<br />) just meant to force a space.

<p></p> will give you more flexibility via CSS to style individual
paragraphs.  You might not have that need now, which is fine.  But by
replacing all <p /> elements with <br /><br /> you're effectively giving up
that flexibility forever.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325438
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to