It’s better if you provide examples but based on what I understand it’s possible, you can do regex for searching and return that Contact based on the regex result.