I experimented with various patterns in an attempt to detect the B button by itself, but the patterns were unsuccessful as they also detected RB and LB.
I tried different variations:
/B(?!^LB$|^RB$)/g
/^B$|^B,$|^ B,$/g
/^B$|^B,$|^ B,$(?!^LB$|^RB$)/g
The goal is to have a pattern that can identify B on its own or followed by a comma and/or space.