import re def extract_image_urls(text): # Regular expression to match image URLs pattern = re.compile(r'https?://[^\s]+\.jpg|https?://[^\s]+\.jpeg|https?://[^\s]+\.png|https?://[^\s]+\.gif|https?://[^\s]+\.bmp|https?://[^\s]+\.webp') # Find all matches in the input text matches = pattern.findall(text) return matches