Give this a shot:
REReplace(string,'("[^"]*")?([^"]),','\1\2;','ALL')
You may need to while-loop this just in case you have
multiple commas to replace after a single quoted string:
while (REFind('("[^"]*")?([^"]),',string)) {
REReplace(string,'("[^"]*")?([^"]),','\1\2;','ALL');
}
hth
ike
On Tue, 07 Nov 2006 13:39:24 -0400
morgan lindley <[EMAIL PROTECTED]> wrote:
> I've been banging my head against the wall with this one, and regex is not my
> strong suit anyhow. CFPop seems to be grabbing the headers, and comma
> delimiting all the "to" addresses. The trouble comes in when there are
> display names with commas in them as well (they are quoted eg "grey, morgan"
> <[EMAIL PROTECTED]>).
> What I need is to use REReplace() or similar to change a string that looks
> like:
>
> "grey, morgan" <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
>
> to:
> "grey, morgan" <[EMAIL PROTECTED]>;[EMAIL PROTECTED]
>
> Change the comma between addresses to semicolon, but leave the comma in the
> display names alone. I found this ""[^""]*""|[^,]+ at
> (http://regexadvice.com/blogs/wayneking/archive/2004/01/12/271.aspx) that
> says it does this, but testing has it matching the comma inside the quotes as
> well.
>
> To me, this seems like it should be as simple as matching all the commas that
> are not inside quotes, but I can't get it to work so I'm open to any
> suggestions.
>
> thanks,
> -morgan
--
s. isaac dealey 512.372.8890
new epoch isn't it time for a change?
http://coldfusion.sys-con.com/author/4806Dealey.htm
http://www.fusiontap.com
http://www.turnkey.to
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive: http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:983
Subscription: http://www.houseoffusion.com/groups/RegEx/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21