我想将捕获的组内容存储在正则表达式搜索变量
中Dim input As String ="asdfd sdf dsf fdsf <disp-formula id=""deqn1-3""> fdsf fds df"
Dim regex As Regex = New Regex("<disp-formula id=""deqn(\d+)-(\d+)"">")
Dim match As Match = regex.Match(input)
If match.Success Then
\\ put the values represented by (\d+) and (\d+) in two variables and then use them in a loop
可以在vb.net中完成吗?如果是这样的话?
答案 0 :(得分:0)
只需使用match
Dim g1 = match.Groups(1).Value ' 1 in your sample
Dim g2 = match.Groups(2).Value ' 3 in your sample