以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 老师,求一正则表达式 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=169938) |
-- 作者:fntfgz -- 发布时间:2021/7/6 22:29:00 -- 老师,求一正则表达式 老师,我有如下一行数据,我想用正则匹配提取出里面的"[01]",":0638"," 09",请问如何写? 志愿[01]:0638河北农业大学(渤海校区)[公办] 09食品科学与工程 |
-- 作者:有点蓝 -- 发布时间:2021/7/6 22:39:00 -- Dim pattern As String = "[0-9]+" Dim txt = "志愿[01]:0638河北农业大学(渤海校区)[公办] 09食品科学与工程" 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
|