wikisoli.blogg.se

Balancing equation calculator
Balancing equation calculator









balancing equation calculator

we will use the to remove the first character of our segment as it’s a bracket we don’t need. The rest of the compound will be the first segment. we now know that the number to the right of the parenthesis which I refer to as a “multiplier” will be the second half of our split. We are now going to loop through our segments, if a segment begins with a ( we want to split the segment so that the part with the number is separated from the rest. If you want to play around with regular expressions you can view this one here. and the near the end, indicate that we want to include ALL digits to the right of our parenthesis in our split.

balancing equation calculator

It means that we are ok with having zero or infinite many letters(of any case) or numbers within our parenthesis. The inner parenthesis with the forward slash before them mean that we want to literally find parenthesis(this is called escaping) the indicate that we are ok with any letter(of any case) or number within our parentheses and the asterisk after the square brackets is a quantifier.

balancing equation calculator

To breakdown the regex, the outermost parenthesis(near the single quotes) indicate that that is our capture group and it is what we want to keep.











Balancing equation calculator