if i want to find every odds which has the following format - ( 1.64 - 2.38), how do i code regex?
<td class="t-odds">
1.64 - 2.38
</td>
re.findall(r'bets/.+?/.+?">(.+?)</a>',Tennis)
if i want to find every odds which has the following format - ( 1.64 - 2.38), how do i code regex?
<td class="t-odds">
1.64 - 2.38
</td>
re.findall(r'bets/.+?/.+?">(.+?)</a>',Tennis)
What you are looking for is probably this regex: (\d+\.\d+)\s\-\s(\d+.\d+)
But honestly, as @jonrsharpe and others have suggested in comments, what you should do is use an HTML parser. Not only is it safer, it is easier.
You can try a live demo of my regex here, on Regex101.com.