I would like to suggest a solution simple and readable also for beginners and that doesn't use any import module.
In my code I simply parse the string character by character with a for loop and check if the current character is "/".
I use enumerate because it allows me to access both the index and the value of the current character during the iteration.
In case "/" is found I use Python's slicing to check if "mg" is coming before it and use this information to replace it with whitespace or not.
Solution
data = ['ABACAVIR/LAMIVUDINE TEVA 600 mg/300 mg, comprimé pelliculé' 'ABACAVIR/LAMIVUDINE ZENTIVA 600 mg/300 mg, comprimé pelliculé']
new_data = []
for line in data:
result = ""
for key, value in enumerate(data):
if value == "/" and data[key-2:key] != "mg":
result += ' ' # replace with white space
else:
result += value
new_data.append(result)
print(new_data)
Output
['ABACAVIR/LAMIVUDINE TEVA 600 mg/300 mg, comprimé pelliculéABACAVIR/LAMIVUDINE ZENTIVA 600 mg/300 mg, comprimé pelliculé']