Your question is Regex Matching With Wildcards. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Confluent Cloud tooling can use wildcard filters when selecting resource names for event-routing or monitoring operations. Given a string and a pattern, determine whether the entire string matches the entire pattern.
The pattern supports two wildcard characters:
? matches exactly one character.* matches zero or more characters.Matching is case-sensitive, and the pattern must consume the complete string. Return True when the pattern matches and False otherwise.
Implement wildcard_match(s, pattern).
s and pattern.? and * charactersdef wildcard_match(s, pattern):