I'm having trouble grabbing a specific piece of text.
My input is:
PMT(B1+B144+B145*1/12.0,B148+B149*1*12.0,B1)
I want to grab all the B1's, but when I'm trying to do that I'm getting B1, B144, B148, B1. My first solution was to check the following character. So I came up with the regex B1[\W]. There are two problems with this: One it ends up grabbing the non word character, and two it doesn't work with "=B1".
How can I grab specific B1s? For this example I want the first and last B1.
Edit: I'm using the Java String function replaceAll