I am trying to write a regular expression to find all characters which are both preceded and followed by '+' sign.
Eg: For input
+z+45+v89+b+
I am expecting two groups i.e +z+
and +b+
.
I have written following regular expression in java which works for the above input
\\+[a-zA-Z]\\+
but fails for following input
+a+b+c+
For second input, I am expecting following groups +a+
, +b+
and +c+