Skip to main content
deleted 37 characters in body
Source Link
AMissico
  • 21.8k
  • 7
  • 80
  • 108
@"\{\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 :)

@"\{\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.

added 67 characters in body; added 111 characters in body
Source Link
leppie
  • 117.6k
  • 18
  • 201
  • 300
@"\{\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*)?\}" 
@"\{\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 :)

deleted 37 characters in body
Source Link
AMissico
  • 21.8k
  • 7
  • 80
  • 108
@"\{\s*(?<field>\w+)\s*(,\s*(?<width>\d*)\s*)?\}" 

Tip: Learn Regex, it's fun :)

@"\{\s*(?<field>\w+)\s*(,\s*(?<width>\d*)\s*)?\}" 

Tip: Learn Regex, it's fun :)

@"\{\s*(?<field>\w+)\s*(,\s*(?<width>\d*)\s*)?\}" 
Source Link
leppie
  • 117.6k
  • 18
  • 201
  • 300
Loading