My regex matches the comma between two words if it is surrounded by a quote on the left, and a quote on the right, which is exactly how your sample input is formatted. If you want to just match a comma between words, the regex would look like:
/(?<=\p{Alpha}),(?=\p{Alpha})/
But that doesn't take into consideration the quotes your sample input demonstrated. Now you've got two answers; one to the question you asked, and one adapted to the question you inferred by posting sample input slightly different from the exact question.
My split example does that. But if you prefer to match multiple commas on a single line, the answer to that exact question is:
while( $line =~ /,/g ) {
print "Matched a comma.\n";
}
That's probably not the question you really wanted to ask, but we got in trouble for misinterpreting ambiguous or incorrectly specified questions already. I must be sick for being willing to try again after being subjected to hostility in response to my voluntary effort, but I will do so. Perhaps you mean something like this:
while( $line =~ m/(?:^|,)"([\p{Alpha}\s]+)"(?=,|$)/g ) {
print "$1\n";
}
Thiw works as long as none of the fields fall into the pitfalls I discussed in my original post. If they do, I recommend looking at the source code for Text::CSV to learn how that module handles the elevated rigors of balanced quotes and escaped delimiters.
Here is the same regex in a slightly different scaffolding:
print "$_\n" for $line =~ m/(?:^|,)"([\p{Alpha}\s]+)"(?=,|$)/g;