You need to use look-arounds:
new_term = re.sub(r"(?i)(?<=[AZ])-(?=[AZ])", " ", original_term)
Or capture groups:
new_term = re.sub(r"(?i)([AZ])-([AZ])", r"\1 \2", original_term)
Watch the IDEONE demo
Note that [Az] also matches some non-letters (namely [ , \ , ] , ^ , _ and ` ), so I suggest replacing it with [Az] and use the case insensitive modifier (?i) .
Note that you do not need to hide the hyphen outside the character class.
source share