本文介绍了用于验证单个单词的正则表达式 - (大写字母A到Z,数字和周期没有任何空格)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞!我需要帮助 常规表达式 vba 。 我想验证具有产品ID的范围。有效的产品ID  大写字符或数字或 dot like(A102345 , T.35DG)。我已经尝试了以下 code 但 无法理解。 I need help forregular expression forvba. I want to validate ranges which have product ID. The valid Product IDare the one whichhave Uppercase chars or number ordot like (A102345 , T.35DG). I have tried the belowcode but not able to figure out. Public Function ValidNumber(ByVal strNumber As String) As Boolean With CreateObject("VBScript.RegExp") .Global = True .Pattern = "[A-Z0-9.]" ValidNumber = .test(strNumber) End WithEnd FunctionSub test()Debug.Print ValidNumber("AAACVD12@")End Sub推荐答案 您好,感谢您在MSDN论坛上发帖。Thank you for posting in the MSDN Forum.由于该问题与VBA语言的正则表达式而不是Excel对象模型更相关,我想将其移至VBA论坛。Since the issue is more related to the Regex of VBA language instead of Excel Object Model, I'd like to move it to VBA forum.我们建议适当发布的原因是您将获得最合格的受访者群体,而定期阅读论坛的其他合作伙伴可以分享他们的知识或从您与我们的互动中学习。The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.感谢您的理解。 这篇关于用于验证单个单词的正则表达式 - (大写字母A到Z,数字和周期没有任何空格)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-23 07:10