Need help with creating pattern in JAVA
I am working with Pattern and Matcher in Java.
I need help searching for a particular pattern in the following strings (with expected results):
MY/BALL ---> MY/BALL
MY/BALL/B=XYZ ---> MY/BALL
MY-/BIG/WHITE/BALL=XYZ ---> MY-/BIG/WHITE
MY=/BIG/BROWN/B1*2=Y=XYZ ---> MY=/BIG/BROWN
MY=/BIG=/BROWN/BALL=XYZ ---> MY=
This is what I have for my pattern, "/B(.[^/])*=".
If the string has a pattern starting with "/B" and has its matching "=" (before next "/"), then strips the string starting at that pattern.