vb.net查找点号点的出现次数

时间:2016-08-04 11:22:06

标签: regex vb.net string search contains

对于那些对正则表达式有好处的人来说应该是一个真正的快速,我有一些字符串,我想只提取它有一个点,然后是0-9之间的单个数字,最后是另一个点。就这样:

string2.string = no good

string.1.string = match

strstr.9.strstr = match

str3.-3.str = no good

2 个答案:

答案 0 :(得分:1)

你不需要正则表达式,在VB.NET中你有简单的Like-operator

function insertarray($table, $arr){
   foreach($arr as $k => $v){
      $col[] = sanitize($k);
      $val[] = "'".sanitize($v)."'";
   }

   query('INSERT INTO '.sanitize($table).' ('.implode(', ', $col).') VALUES ('.implode(', ', $val).')' );
}

答案 1 :(得分:0)

试试这个:

\.\d\.

演示:https://regex101.com/r/zC3iQ9/1

VB代码:

Dim input = "string.1.string"
Dim pattern = "\.\d\."
Dim matches = Regex.Match(input, pattern).Success