I am having a problem tring to split a sting based on parentheses.
I have a String like this
Fe(C5H5)2FeO3 and I need to split the sting in to an array so the array reads
Fe
(C5H5)2
FeO3
Im an using this code.
String form = "Fe(C5H5)2FeO3";
from.split([()]+);
I am having trouble getting the characther after the “)” to split out.
This also has to work for multiple sets of () in the same string.
Thanks
positive look ahead and look behind can do some of this:
For more on this, check out the regular expressions tutorial