以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 如何从下面字符串中提取字段呢,就是中括号里面的内容 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=174261) |
-- 作者:liufucan -- 发布时间:2022/1/8 1:25:00 -- 如何从下面字符串中提取字段呢,就是中括号里面的内容 [产品] = \'{0}\' And [规格] = \'{1}\' |
-- 作者:有点蓝 -- 发布时间:2022/1/8 9:12:00 -- Dim pattern As String = "{\\w+(?=})}" Dim txt = "[产品] = \'{0}\' And [规格] = \'{1}\'" 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
|