# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"aria-label=\"(\d{1,3})\""
test_str = "<div style=\"position: absolute; left: 0px; top: 0px; z-index: 106; width: 100%;\"><span id=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\" style=\"display: none;\">Możesz się poruszać przy użyciu klawiszy strzałek.</span><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -69px; top: 110px; z-index: 1;\" title=\"\" aria-label=\"2255\" role=\"button\" tabindex=\"0\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 13px; top: -50px; z-index: 1;\" title=\"\" aria-label=\"1530\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -12px; top: 122px; z-index: 1;\" title=\"\" aria-label=\"1392\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -140px; top: 29px; z-index: 1;\" title=\"\" aria-label=\"1136\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -139px; top: -74px; z-index: 1;\" title=\"\" aria-label=\"1121\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -60px; top: 15px; z-index: 1;\" title=\"\" aria-label=\"1056\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -82px; top: -195px; z-index: 1;\" title=\"\" aria-label=\"919\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -198px; top: 23px; z-index: 1;\" title=\"\" aria-label=\"878\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 60px; top: 117px; z-index: 1;\" title=\"\" aria-label=\"730\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 46px; top: -58px; z-index: 1;\" title=\"\" aria-label=\"705\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -185px; top: -64px; z-index: 1;\" title=\"\" aria-label=\"633\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -2px; top: 25px; z-index: 1;\" title=\"\" aria-label=\"590\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -72px; top: -84px; z-index: 1;\" title=\"\" aria-label=\"557\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 56px; top: 21px; z-index: 1;\" title=\"\" aria-label=\"524\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 108px; top: 29px; z-index: 1;\" title=\"\" aria-label=\"419\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -256px; top: -100px; z-index: 1;\" title=\"\" aria-label=\"408\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -128px; top: -192px; z-index: 1;\" title=\"\" aria-label=\"319\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 120px; top: -97px; z-index: 1;\" title=\"\" aria-label=\"313\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -121px; top: 93px; z-index: 1;\" title=\"\" aria-label=\"250\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -6px; top: -166px; z-index: 1;\" title=\"\" aria-label=\"243\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -198px; top: -179px; z-index: 1;\" title=\"\" aria-label=\"238\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -263px; top: -150px; z-index: 1;\" title=\"\" aria-label=\"197\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -243px; top: 13px; z-index: 1;\" title=\"\" aria-label=\"195\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 109px; top: 108px; z-index: 1;\" title=\"\" aria-label=\"148\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 64px; top: -168px; z-index: 1;\" title=\"\" aria-label=\"128\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 113px; top: -174px; z-index: 1;\" title=\"\" aria-label=\"76\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: -177px; top: 86px; z-index: 1;\" title=\"\" aria-label=\"71\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div><div style=\"width: 36px; height: 37px; overflow: hidden; position: absolute; cursor: pointer; touch-action: none; left: 83px; top: 174px; z-index: 1;\" title=\"\" aria-label=\"1\" role=\"button\" tabindex=\"-1\" aria-describedby=\"1754CFBC-3135-4AAF-B4AB-197E77AD840A\"><img alt=\"\" src=\"https://maps.gstatic.com/mapfiles/transparent.png\" draggable=\"false\" style=\"width: 36px; height: 37px; user-select: none; border: 0px; padding: 0px; margin: 0px; max-width: none;\"></div></div>"
matches = re.finditer(regex, test_str)
for matchNum, match in enumerate(matches, start=1):
print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
for groupNum in range(0, len(match.groups())):
groupNum = groupNum + 1
print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html