How to find a string within another, ignoring some characters?
问题 Background Suppose you wish to find a partial text from a formatted phone number, and you wish to mark the finding. For example, if you have this phone number: "+972 50-123-4567" , and you search for 2501 , you will be able to mark the text within it, of "2 50-1". More examples of a hashmap of queries and the expected result, if the text to search in is "+972 50-123-45678", and the allowed characters are "01234567890+*#" : val tests = hashMapOf( "" to Pair(0, 0), "9" to Pair(1, 2), "97" to