如何找出一个字符串中由8位以上数字组成的子串?

ynduanlian 2011-01-27 10:08:27
听说用正则表达式可以,但不知怎么用?
...全文
51 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiongying18 2011-01-27
  • 打赏
  • 举报
回复
Imports System.Text.RegularExpressions


Private Sub aaaaaaaa()
Dim Str_TXT As String = "a1234567899asdf147852369632easdf5852adf85569999999999999999999999999afas5555555555555989"
Dim r As Regex
Dim m As Match
r = New Regex("(\d{9,})", IgnoreCase Or Compiled)
m = r.Match(Str_TXT)
While m.Success
MessageBox.Show(m.Groups(1).Value, "注意")
m = m.NextMatch()
End While
End Sub

wuyq11 2011-01-27
  • 打赏
  • 举报
回复
^(?!\D+$).{8,15}$

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧