I have a String. The string is “New England 12 Philidelphia 24 (Final)”. I need a regaular expression from which i should able to retrieve items like.
- First Team — New England
- First Team Score — 12
- Second Team — Philidelpia
- Second Team Score — 24
- Result — Final or whatever in the braces.
Below is a SSCCE showing how to use regex and groups to extract the data you want.
FYI, although it will work for just the input you provided, this code will scan through input containing multiple results like this, matching all of them in the
whileloop.Output