in reply to RegEx question
Like this?
while (<DATA>) { if (!/,\s+$/) { print; } } __DATA__ 1) this is an example 2) this is an example, 3) this is an example, 4) this is an example [download]