Extract the shortest match between an opening and a closing tag using regex non-greedy quantifiers.
Constraints
Example
>>> shortest_match("a<careful>...<careful>b", "<", ">")
'<careful>'
>>> shortest_match("abcde", "b", "d")
'bcd'
>>> shortest_match("xxabcyyabczz", "abc", "z")
'abcyyabcz'
>>> shortest_match("nothing", "a", "b")
''
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints