This should be easy, but I've managed to stump 2 people so far at work & I've been at it for over 3 hours now, so here goes.
I need to replace a+ with aplus (along with a few other cases) with the Python re module. eg. "I passed my a+ exam." needs to become "I passed my aplus exam."
Just using \ba+ works fine most of the time, but fails in the case of a+b, so I can't use it, it needs to match a+ as a distinct word. I've tried \ba+\b but that fails because I assume the + is a word boundary.
I've also tried \ba+\W which does work, but is greedy and eats up the space (or any other non-alpha char that would be there).
Any suggestions please?