本文介绍了使用VBA在Excel单元格中允许不超过21个字符的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用vba验证在excel工作表单元格中输入的字符.我正在尝试使用模式"^ [a-zA-Z0-9] {21,21} $".我希望它精确匹配21个字符(可以是字母数字),且不超过此数目.当字符少于21个字符时,它可以正常工作,但是当字符超过21个字符时,它不能正常工作.请建议我该如何实现.
感谢您的帮助.
在此先感谢,
Sunny K
Hi,
I want to verify the characters entered in excel sheet'' cell using vba. I''m trying this with the pattern "^[a-zA-Z0-9]{21,21}$". I want this to match exactly 21 characters (can be alphanumeric) and no more or less than that. Its working fine when the characters are less than 21 characters but not when they exceed. Please suggest me how could I achieve that.
I appreciate any help.
Thanks in Advance,
Sunny K
推荐答案
^[a-zA-Z0-9]{21}
这篇关于使用VBA在Excel单元格中允许不超过21个字符的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!