I have a set of expressions representing some formula with some parameters inside. Like:
[parameter1] * [parameter2] * [multiplier]
And many others like this.
I want to use a regular expression so that I can get a list of strings (List<string>) which will have the following inside:
[paramter1][paramter2][multiplier]
I am not using regular expressions so often; if you have already used something like this I would appreciate if you can share.
Thanks!
This should do it:
Using .net:
You may want to use a capturing group here:
\[(\w+)\], so you have the parameter’s name onGroups[1].