I need a pattern (java regexp) which matches if there is a comma after key or key is at the end of line. i.e it should match both of followings:

```
1. xxxkey,yyy
2. xxxkey

```

Ive tried `[\\,$]` pattern but it doesn't work.