Code:

import re

# The regular expression pattern for a coefficient
pattern = r"([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)\s*\*?\s*[a-zA-Z]"

# Test string
test_string = "2.7e-3*x + 4.5*y - z"

# Find all matches
matches = re.findall(pattern, test_string)

# Print matches
for match in matches:
 ¬† ¬†print(match)
farmer40x40