#!/usr/local/bin/perl -w use strict; my $string = q{"2","T,E,S,T,B","Lazowsky","Mike's","Teststring"}; $string =~ s/,(?!")//g; print qq{[$string]\n};