Let's say I have this string
'1. A4 1... d5 2. c4 2... Yf6 3. NP3 3... dxc4 4. BO3 4... BK4 5. e3 5... Bf3 6. Q3 6... e6 7. Bc4 7... B4 8. O-O 8... B3 9. b3 9... O-O 10. B3 10... Re8 11. Q7 1-0'
I want to remove the numbers not attached to letters and if you scroll to the end I want the 1-0 removed as well, so something like this
['A4', 'd5', ..., 'O-O', ..., 'Q7']
So I tried this,
re.findall(r'(?:[^\W\d_]+\d|\d+[^\W\d_])[^\W_]*|[^\W\d_]+', text)
but got this,
['A4', 'd5', ..., 'O', 'O', ..., 'Q7']
So it is removing the - for 1-0 which I want, but also to O-O.
-for1-0"? Isn't it removing all of1-0?