How to write a regex for string matches which starts with @ or end with ,. I am looking for a code in JavaScript.