四月二日(2)

正则表达式,普通字符、元字符(metacharacter)

 1 Imports System.Text.RegularExpressions
 2 Module Module1
 3     Public Sub Main()
 4         Dim strTxt As String
 5         Dim rgxExp As New System.Text.RegularExpressions.Regex("^[1-9]\d*$")
 6         strTxt = "a12345"
 7         Dim flag As Boolean = rgxExp.IsMatch(strTxt)
 8         Console.WriteLine(flag)
 9         Console.Read()
10     End Sub
11 End Module

引用类库,原来错添加了vbscript的

http://deerchao.net/tutorials/regex/regex.htm 正则表达式30分钟入门教程

看别人的例子,再在库内查相关的类是最快的方法。

vb中的andalso逻辑运算与&有什么区别?

原文地址:https://www.cnblogs.com/xtypeu/p/2995792.html