Hi all,
I'm completely new to regular expressions and I'm having a little trouble grasping all the concepts behind how to use regular expressions.
I have a
String array that contains a series of weights:
At the moment, I'm adding up all the weights using a StringTokenizer to extract the numbers as follows:
I'm figuring that this is a rather inefficient way of doing things, as a new StringTokenizer object is created and subsequently destroyed on every run through the for loop.
Thus I turned to regular expressions for help. At the moment I've got:
What I'm suppose to do now is where I'm lost. I've even tried the following, to no avail.
Any help would be very much appreciated.
Thanks