Dim pattern As String = "\[\w+(?=\])\]" 'Dim pattern As String = "\{\w+(?=\})\}"
Dim txt = "if([单重]>400,24*{数量1},if([单重]>200,12*{数量2},if([单重]>70,8*[数量],if([单重]>50,6*[数量],if([单重]>40,5.5*[数量],if([单重]>30,5*[数量],if([单重]>20,4.5*[数量],if([单重]>10,4*[数量],if([单重]>2,3.5*[数量],3*[数量])))))))))"
Dim rgx = new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
For Each match As System.Text.RegularExpressions.Match In rgx.Matches(txt)
Output.Show(match.Value )
Next