in reply to Regular Expression Question

It's probably simpler and clearer (as well as more efficient) to use two regexes for this type of thing.

for ('fred,bill', 'fred,,bill', ',fred', 'bill,') { print "Bad:'$_'" unless $_ =~ m[^[a-zA-Z0-9,]+$] and $_ !~ m[,{2}|,$|^,]; } Bad:'fred,,bill' Bad:',fred' Bad:'bill,'

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!
Wanted!