You can’t use ^ and $ in character classes in the way you wish – they will be interpreted literally, but you can use an alternation to achieve the same effect:
(^|,)garp(,|$)
You can’t use ^ and $ in character classes in the way you wish – they will be interpreted literally, but you can use an alternation to achieve the same effect:
(^|,)garp(,|$)