>   return REReplaceNoCase(ListSort(list,type),"([^,]+)(,\1)*","\1","ALL");

> I haven't tested this and I can't vouch for the performance but you have 
> to admit that (if it works) it is a very cool bit of code...

Nice one.

Results were pretty much the same for both HashSet and regex versions, but
the latter is maybe nicer having the benefit of being native CF (if that's
actually a benefit).

HOWEVER!  It took me a wee bit to work out why the regex one didn't quite
work.

Rather enigmatically, this will return:
137,141,227,290,296,33,394,481,526,535,58,644,72,861,908,913,925,960

When the answer should actually be:
137,14,141,227,290,296,33,394,481,526,535,58,6,644,72,861,908,913,925,960

Note that the 14 and the 6 have been "deduped" incorrectly.

I scratched my head but it's because it's not matching the second grouping
correctly: 14,141 is being matched as 14,14

After a bit of scratching around, I came up with this fix for it:

REReplaceNoCase(ListSort(list,type),"([^,]+)((,\1)(\b))*","\1\4","ALL");

I tested this over quite a number of iterations and it seems to work OK.  



-- 

Adam

---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to