I have not found any commandline tool which would print output only if it matches given wildcards. Wildcards * and ? needs to be supported.
For example
echo 192.168.1.1 | WildcardMatch "19?.168.*"
echo aa-02-23201 | WildcardMatch "*-??-232*"
Tried to implement this by using a batch file and calling PowerShell but this is way too slow. https://support.microsoft.com/en-us/office/using-the-like-operator-and-wildcard-characters-in-string-comparisons-c472b6df-0d3e-4ffc-a21c-bb5721cc460a
Edit: -i is needed to make the match case-sensitive.