[thelist] Regex remove repeats

fstorr fffrancis at fstorr.demon.co.uk
Wed Jan 26 05:02:18 CST 2005


Hi all

I've got a large amount of repeating data that I need to strip down so 
that there's only one instance of each name.  For example, I've got:

ac/dc,ac/dc,ac/dc,ac/dc,david bowie,david bowie,dixie chicks,dixie 
chicks,black sabbath,zz top,zz top,zz top,zz top

I'm stuck on writing a regex that is going to lok ahead to see if the 
next item in the comma separated list is the same as the last and, if it 
is, to remove it.

Any help greatly appreciated.

Regards

F



More information about the thelist mailing list