I have string templates that can be in any of these below 3 forms. How can I extract the list of strings that are enclosed between the parenthesis? I need the output from all of these strings to be same which is
{CustID}, {Name}, {Contact}, {Address1}, {Address2}
Examples:
/Customer/Initiation/{CustID}?Name={Name}&Contact={Contact}&Address1={Address1}&Address2={Address2}
/Customer/Initiation/{CustID}/{Name}?Contact={Contact}&Address1={Address1}&Address2={Address2}
/Customer/Initiation/{CustID}/{Name}/{Contact}?Address1={Address1}&Address2={Address2}
I found out that there is a utility in asp net core which can parse a query string and produce a list of key/value pairs. But in my case, it can't parse {string} that are not in the key/value format in the url template. Is there a way to achieve this without using Regex ?
Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery()
Thanks for any suggestions!