Shortmeister1
Board Regular
- Joined
- Feb 19, 2008
- Messages
- 204
- Office Version
- 365
- 2016
- 2013
- 2010
- 2007
- 2003 or older
- Platform
- Windows
Hi
<code style="margin: 0px; padding: 1px 5px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; background-color: rgb(239, 240, 241); white-space: pre-wrap; color: rgb(36, 39, 41);">"[A-Z]*"</code>
To my understanding, this should mean alpha only so that "BOB" would be True and "Bob" would be False.
It's not working of course! Am I missing something important?
<code style="margin: 0px; padding: 1px 5px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; background-color: rgb(239, 240, 241); white-space: pre-wrap; color: rgb(36, 39, 41);">"[A-Z]*"</code>
To my understanding, this should mean alpha only so that "BOB" would be True and "Bob" would be False.
It's not working of course! Am I missing something important?
Code:
Sub test1()Dim str As String
Dim regEx As New RegExp
Dim blnTest As Boolean
With regEx
.IgnoreCase = False
.Pattern = "[A-Z]*"
End With
str = "Bob"
blnTest = regEx.test(str)
Debug.Print str & vbTab & blnTest
Set regEx = Nothing
End Sub