I have a string with text inside curlies like this:
{field1}-{field}+{field3}Anthing{field4}
from which I need to get an array like this:
['field1', 'field2', 'field3', 'field4']
Is there a way to do it using regexes in c#?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use Split and Linq:
Or, you can match for
{...}tokens using a simple regular expression:\w*would only match alphanumeric characters, you may want to replace it with[^}]*or.*?.