Matches a String value against a predefined specification.
Matching can be done in three modes depending on ctor matchSpec argument.
If matchSpec is null, match will succeed for any value (including empty String and null)
If matchSpec starts with ~ character it will be treated as java.util.regex.Pattern, with the ~
character ommited.