用于验证单个单词的正则表达式 - (大写字母A到Z,数字和周期没有任何空格) [英] Regular expression to validate single word - ( Uppercase A to Z , Number & Period without any space)

查看:377
本文介绍了用于验证单个单词的正则表达式 - (大写字母A到Z,数字和周期没有任何空格)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助
<跨度类= "x_x_x_x_GINGER_SOFTWARE_mark" ID = "x_x_x_x_ddf90edb-7169-4558-b3ba-b193874883af"> <跨度类= "x_x_GINGER_SOFTWARE_mark" ID ="x_x_29560d25- 18b2-4c50-af43-66731cf74982">常规
表达式

<跨度类=" x_x_x_x_x_x_GINGER_SOFTWARE_mark" ID = "x_x_x_x_x_x_584f3581-b4fe-429B-b389-03203e598f35"> <跨度类= "x_x_x_x_GINGER_SOFTWARE_mark" ID = "x_x_x_x_8574b3d4-150a-4f10-95b7-d2c71dfbc4d1"> < span class ="x_x_GINGER_SOFTWARE_mark"id ="x_x_f5b85df0-b01a-4327-9762-d72e3156ae91"> vba

我想验证具有产品ID的范围。有效的产品ID


 大写字符或数字或

dot like(A102345 T.35DG)
。我已经尝试了以下
<跨度类= "x_x_x_x_x_x_x_x_GINGER_SOFTWARE_mark" ID = "x_x_x_x_x_x_x_x_9708cec6-2f82-43fa-B410-ddedae7f656d">
<跨度类= "x_x_x_x_x_x_GINGER_SOFTWARE_mark" ID ="x_x_x_x_x_x_eb7d14d4-52b0-45a4- ad65-757f3c8fea73"> code
无法理解。 

I need help for regular expression for vba. I want to validate ranges which have product ID. The valid Product ID are the one which have Uppercase chars or number or dot like (A102345 , T.35DG). I have tried the below code 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 With
End Function


Sub 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,数字和周期没有任何空格)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆