I need to verify if a string format has correct number and position of parameters. In my system advanced users (administrators) can configure a option with string format and select the params in combobox, one specific combobox to position in format. To save I need verify if this configuration is correct.
This is to generate a unique code to a record, this code is specific for each client.
In my screen I have a text box to the format, that can contain up to 6 items (or less), for each item i have one combobox. The comboboxes contains a type of the value (ex. sequence, year, number, nothing (in case it's not required, etc). I need verify if the format is correctly (ex. {0}-{1} is correct and {0}-{1}.{3} is wrong) and respective comboboxes are selected (ex. {0}-{1} require select a type in combobox 0 and 1)
--update--
I have resolved this question verifing the number of parameters in the string format is match with the number of values selecteds and the order of the values selecteds (ex. if the user keep any value empty and selected the next I have assumed this is incorrect) and I try generate a string with the format and values informed
{xx}patterns from your string and then check is something selected or not according to thexxvalue. It's hard to suggest more without seeing your code and clear undersnanding what's going on at your side.