Consider the string:
<p class="sm clg" data-rlocation="Uttam Nagar East">Uttam Nagar East, Delhi <span class="to-txt" id="citytt1">B-24, East Uttam Nagar, Uttam Nagar East,<br>Delhi<span> - </span>110059
I want to get the result Uttam Nagar East
using a regex function, but the output I'm getting is
Uttam Nagar East">Uttam Nagar East, Delhi <span class="to-txt" id="citytt1'
I've tried using
print(re.findall(r'data-rlocation="(.*)["]',contents))
and
print(re.findall(r'data-rlocation="(.*)"',contents))