human
how do i return a string from a regex match in python
assistant
Here is some code to return a string from a regex match with pattern '<img.*?>' in string 'line'

imtag = re.match('<img.*?>', line).group(0)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.