The following script is working for me in Python:
input = """Above 85°C the rated (DC/AC) voltage must be derated at per 1.5%/2.5%°C
WVDC: 400 Volts DC
SVDC: 600 Volts DC"""
result = re.findall(r'(WVDC).*\r?\n', input)
print(result)
['WVDC']
Note that the only substantial change I made to the regex pattern was to make the carriage return \r
optional. So it seems that multiline strings in Python, perhaps what your source uses, carry only newlines, but not carriage returns. In any case, using \r?\n
to match newlines is generally a good idea, because it can cover both Unix and Windows line endings at the same time.