Found it myself!
Code:
Sub check_format()
Dim ok As Boolean
Dim str As String
'select the cell to check and run the macro - "ok" is the boolean that will...
'...determine whether the pattern is matching. It is set to true if the cell matches...
'...one of the allowed patterns.
str = Selection.Value
ok = False
Select Case True
Case str Like "##[.]": ok = True
Case str Like "##[.]##[.]": ok = True
Case str Like "##[.]##[.]##[.]": ok = True
Case str Like "##[.]##[.]##[.]##[.]": ok = True
End Select
If ok = False Then
MsgBox ("Wrong pattern!")
Else
MsgBox ("Pattern is ok!")
End If
End Sub
As said, I'm new to vba and my coding might not be as efficient as it could be.
I do like the "case" method as it is very readable and easy/convenient to add or delete new patterns.
Cheers!