I'm trying to filter text in python
import re
text = "Fast charging 25W, USB Power Delivery 3.0, Fast Qi/PMA wireless charging 12W, Reverse wireless charging 4.5W"
regex = re.compile("\w+\s\w+harg\w+\s\d+W")
mc = regex.findall(text)
print(mc)
The result is
['Fast charging 25W', 'wireless charging 12W']
However, what I wanna do is get all occurrences end with *W"
['Fast charging 125W', 'Fast Qi/PMA wireless charging 12W', 'Reverse wireless charging 4.5W']
The number can be much larger(Like Charge 1250W) I googled almost 2 hours with lots of document about regexp but in vain. any help will be appreciated.
Thank you.