May-02-2023, 08:17 PM
Your findall only matches when there is a "weight" followed by one character from [;:]. That character isn't optional. If it's missing, no match.
So you want it to be an optional match. Add a
So you want it to be an optional match. Add a
?
after the character class.r'(?<=weight[:;]?).*?(?=kg)