I have some HTML in which I want to find string which contains comma-separated number like
871,174 Views (this could range from 1 to n with commas in it)
I tried many for example
'(\d+(,d+)*)\sViews'
but can't make it work because when I run
re.findall(r'(\d+(,d+)*)\sViews', string)
, it gives
[('174', '')]
Actually I want to get the number.
Edit 1: this is the string I'm passing to regex
<span class="fcg"><span id="fbPhotoPageCreatorInfo"></span></span><div class="mbs fbPhotosAudienceContainerNotEditable" id="fbPhotoPageAudienceSelector"><span class="mrs fbPhotosAudienceNotEditable fsm fwn fcg">Shared with:</span><div class="_6a _29ee _3iio _20nn _43_1" data-hover="tooltip" aria-label="Public" data-tooltip-alignh="center"><i class="img sp_e0NUBoHLxu_ sx_9486cc"></i><span class="_29ef">Public</span></div> </div><div></div><span class="fcg">871,174 Views</span>