you probably want a non-capturing  group here. Also, I'd write it more like `/(?:^|[\s.,;(]|<br>)$/` (if that still works)