- "*" – matches any number of characters
- "?" – matches any 1 character
- "[]"– matches any 1 character specified between the brackets
- "- " matches any range of characters e.g. [a-z] matches any non-capital 1 letter of the alphabet
- "#" – matches any digit character
Matching against letters
If
"My house number is 22"
Like
"*##"
then
Debug.Print
"Match: String contains a 2 digit number"
End
If
Matching against numbers
1
2
3
If
"My house number is 22"
Like
"*##"
then
Debug.Print
"Match: String contains a 2 digit number"
End
If
Matching a phone number with either dashes or dots
Matching a certain string within another string
No comments:
Post a Comment