@"\{\s*(?<field>\w+)\s*(,\s*(?<width>\d*)\s*)?\}" Usage: Use Regex.Matches and extract the groups from each
Edit: You could add the static text in the expression too, but that would make it 'harder' to read IMO.
Tip: Learn Regex, it's fun :)
@"\{\s*(?<field>\w+)\s*(,\s*(?<width>\d*)\s*)?\}" Usage: Use Regex.Matches and extract the groups from each
Edit: You could add the static text in the expression too, but that would make it 'harder' to read IMO.
Tip: Learn Regex, it's fun :)