It was tough coming up with an appropriate title for my question. First a little background information in case you need it.
*I have a bill that I am trying to read information off of using regexes. I save the information I need into 4 different tables: Account, Utility, Location, and Taxes.
The logic being that each bill has only one account number (account level). Each account number can pertain to multiple utilities (utility level). Each utility can have multiple locations (assume only 1 location for this question). and each location can have more than one Tax.*
So for the bill found HERE We can see that 4 Taxes (City Sales Tax of 2.97, County Sales Tax of 1.46, State Sales Tax of 3.44, and PPRTA Tax of 1.10) all belong to The 'Electric' Utility. We also see that 4 utilities (Electric, Gas, Water and Wastewater) belong to 1 Account Number, each with their own taxes.
Previously I have been doing something simple like this to capture all of the taxes in one capture group, multiple times: Tax:. \$(.)
What I am trying to accomplish now is to build a regex that Finds all of the taxes only for a given utility. Again, it must be in one capture group with multiple matches.
Here is an example of what I have so far for the Electric taxes: (?:Electric Commercial Service(?:.\n)?.?Tax:.* \$(.)(?:.\n)?.?Total charge this service)*
As you can see, this only picks up the first tax. I can not figure out a way to make it catch every tax between the words "Electric Commercial Service" and the "Total charge this service" pertaining to Electric service.
Thanks!