# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(content|href)=\"(?<url>(http|https)://www\.youtube\.com[^\"]+watch[^\"]+)\""
test_str = ("<html lang=\"es\"><head>\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta content=\"text/html; charset=utf-8\"><style type=\"text/css\">\n"
"<!--\n"
"*\n"
" {font-family:arial,Arial,sans-serif}\n"
"@media only screen and (max-device-width: 480px) {\n"
"body.suppress-border-on-mobile\n"
" {margin:0!important;\n"
" border:0!important;\n"
" padding:0!important}\n"
"table.suppress-on-mobile, td.suppress-on-mobile, div.suppress-on-mobile, img.suppress-on-mobile, span.suppress-on-mobile\n"
" {display:none!important;\n"
" width:0px!important;\n"
" height:0px!important;\n"
" line-height:0px!important;\n"
" margin:0!important;\n"
" border:0!important;\n"
" padding:0!important}\n"
"table.outer-container-width, td.outer-container-width\n"
" {width:640px!important}\n"
"td.outer-container-padding-width\n"
" {width:20px!important}\n"
"table.inner-container-width, td.inner-container-width\n"
" {width:600px!important}\n"
"table.header-container-width\n"
" {width:600px!important;\n"
" height:100px!important}\n"
"td.header_left_padding_width\n"
" {width:25px!important}\n"
"td.logo_container_size\n"
" {width:575px!important;\n"
" height:100px!important}\n"
"img.header_logo_size\n"
" {height:47px!important}\n"
"table.footer-padding-width, td.footer-padding-width\n"
" {width:30px!important}\n"
"table.footer-width, td.footer-width\n"
" {width:540px!important}\n"
"td.footer-font, div.footer-font\n"
" {font-size:20px!important;\n"
" line-height:30px!important}\n"
"table.footer-content-padding-height, td.footer-content-padding-height\n"
" {height:30px!important}\n"
"table.large-section-padding-height, td.large-section-padding-height\n"
" {height:16px!important}\n"
"table.small-section-padding-height, td.small-section-padding-height\n"
" {height:20px!important}\n"
"table.content-container-padding-width, td.content-container-padding-width\n"
" {width:30px!important}\n"
"table.content-container-padding-height, td.content-container-padding-height\n"
" {height:30px!important}\n"
"table.content-container-width, td.content-container-width\n"
" {width:540px!important}\n"
"span.video-title-font-class, td.video-title-font-class, div.greeting-font, td.greeting-font\n"
" {font-size:24px!important;\n"
" line-height:30px!important}\n"
"a.video-link-font-class, div.video-link-font-class, td.video-link-font-class\n"
" {font-size:20px!important;\n"
" line-height:30px!important}\n"
"span.meta-data-font, div.meta-data-font, a.meta-data-font, td.meta-data-font\n"
" {display:block!important;\n"
" font-size:20px!important;\n"
" line-height:36px!important}\n"
"td.small-meta-data-font\n"
" {font-size:25px!important;\n"
" line-height:30px!important}\n"
"table.video-content-padding-height, td.video-content-padding-height\n"
" {height:45px!important}\n"
"td.avatar-size, img.avatar-size\n"
" {width:54px!important;\n"
" height:54px!important}\n"
"img.large-avatar-size\n"
" {height:32px!important}\n"
"img.channel-avatar-size\n"
" {width:80px!important;\n"
" height:80px!important}\n"
"img.thumbnail-size-class, td.thumbnail-size-class\n"
" {width:100px!important;\n"
" height:56px!important}\n"
"table.more-videos-size\n"
" {height:100px!important}\n"
"div.more-videos-font, td.more-videos-font\n"
" {font-size:24px!important;\n"
" line-height:27px!important}\n"
"table.more-videos-button-size\n"
" {width:230px!important;\n"
" height:60px!important}\n"
"td.more-videos-button-width\n"
" {width:250px!important}\n"
"td.more-videos-text-width\n"
" {width:270px!important}\n"
"table.video-spotlight-width\n"
" {width:600px!important;\n"
" height:332px!important}\n"
"td.video-spotlight-size, img.video-spotlight-size\n"
" {width:600px!important;\n"
" height:332px!important}\n"
"table.regular-button-height\n"
" {height:60px!important}\n"
"td.regular-button-padding-width\n"
" {width:20px!important}\n"
"td.regular-button-font\n"
" {font-size:27.5px!important;\n"
" line-height:27.5px!important}\n"
"img.play-button-img-size\n"
" {width:20px!important;\n"
" height:20px!important}\n"
"table.large-button-size\n"
" {width:600px!important;\n"
" height:70px!important}\n"
"table.video-2col-size\n"
" {width:600px!important}\n"
"table.video-2col-width, td.video-2col-width\n"
" {width:600px!important}\n"
"img.video-2col-thumb-size\n"
" {width:600px!important;\n"
" height:332px!important}\n"
"table.video-2col-outer-container-size, td.video-2col-outer-container-size\n"
" {width:600px!important}\n"
"table.video-2col-inner-container-size, td.video-2col-inner-container-size\n"
" {width:540px!important}\n"
"table.video-2col-inner-container-width, td.video-2col-inner-container-width\n"
" {width:540px!important}\n"
"div.section-title-font, td.section-title-font\n"
" {font-size:30px!important;\n"
" line-height:35px!important}\n"
"div.section-subtitle-font, td.section-subtitle-font\n"
" {font-size:25px!important;\n"
" line-height:25px!important}\n"
"table.video-3col-padding-height, td.video-3col-padding-height\n"
" {height:55px!important}\n"
"img.video-3col-thumb-size, table.video-3col-thumb-size\n"
" {width:600px!important;\n"
" height:332px!important}\n"
"table.video-3col-width, td.video-3col-width\n"
" {width:600px!important}\n"
"table.inner-3col-content-container-width, td.inner-3col-content-container-width\n"
" {width:600px!important}\n"
"td.small-pad-width\n"
" {width:20px!important}\n"
"img.channel-avatar-size\n"
" {width:80px!important;\n"
" height:80px!important}\n"
"span.follow-and-subs-font\n"
" {display:block!important;\n"
" font-size:24px!important;\n"
" line-height:27px!important;\n"
" max-height:30px!important}\n"
"td.social-logo-padding-width\n"
" {width:32px!important}\n"
"table.channel-owner-block-content-width, td.channel-owner-block-content-width\n"
" {width:420px!important}\n"
"td.show-only-on-mobile\n"
" {display:block!important;\n"
" width:100%!important;\n"
" max-height:100%!important;\n"
" overflow:visible!important}\n"
"td.show-not-on-mobile, tr.show-not-on-mobile\n"
" {display:none!important;\n"
" visibility:hidden!important}\n\n"
" }\n"
"-->\n"
"</style><style type=\"text/css\">\n"
"<!--\n"
"*\n"
" {font-family:arial,Arial,sans-serif}\n"
"@media only screen and (max-device-width: 480px) {\n"
"body[class=suppress-border-on-mobile]\n"
" {margin:0!important;\n"
" border:0!important;\n"
" padding:0!important}\n"
"table[class=suppress-on-mobile], td[class=suppress-on-mobile], div[class=suppress-on-mobile], img[class=suppress-on-mobile], span[class=suppress-on-mobile]\n"
" {display:none!important;\n"
" width:0px!important;\n"
" height:0px!important;\n"
" line-height:0px!important;\n"
" margin:0!important;\n"
" border:0!important;\n"
" padding:0!important}\n"
"table[class=outer-container-width], td[class=outer-container-width]\n"
" {width:640px!important}\n"
"td[class=outer-container-padding-width]\n"
" {width:20px!important}\n"
"table[class=inner-container-width], td[class=inner-container-width]\n"
" {width:600px!important}\n"
"table[class=header-container-width]\n"
" {width:600px!important;\n"
" height:100px!important}\n"
"td[class=header_left_padding_width]\n"
" {width:25px!important}\n"
"td[class=logo_container_size]\n"
" {width:575px!important;\n"
" height:100px!important}\n"
"img[class=header_logo_size]\n"
" {height:47px!important}\n"
"table[class=footer-padding-width], td[class=footer-padding-width]\n"
" {width:30px!important}\n"
"table[class=footer-width], td[class=footer-width]\n"
" {width:540px!important}\n"
"td[class=footer-font], div[class=footer-font]\n"
" {font-size:20px!important;\n"
" line-height:30px!important}\n"
"table[class=footer-content-padding-height], td[class=footer-content-padding-height]\n"
" {height:30px!important}\n"
"table[class=large-section-padding-height], td[class=large-section-padding-height]\n"
" {height:16px!important}\n"
"table[class=small-section-padding-height], td[class=small-section-padding-height]\n"
" {height:20px!important}\n"
"table[class=content-container-padding-width], td[class=content-container-padding-width]\n"
" {width:30px!important}\n"
"table[class=content-container-padding-height], td[class=content-container-padding-height]\n"
" {height:30px!important}\n"
"table[class=content-container-width], td[class=content-container-width]\n"
" {width:540px!important}\n"
"span[class=video-title-font-class], td[class=video-title-font-class], div[class=greeting-font], td[class=greeting-font]\n"
" {font-size:24px!important;\n"
" line-height:30px!important}\n"
"a[class=video-link-font-class], div[class=video-link-font-class], td[class=video-link-font-class]\n"
" {font-size:20px!important;\n"
" line-height:30px!important}\n"
"span[class=meta-data-font], div[class=meta-data-font], a[class=meta-data-font], td[class=meta-data-font]\n"
" {display:block!important;\n"
" font-size:20px!important;\n"
" line-height:36px!important}\n"
"td[class=small-meta-data-font]\n"
" {font-size:25px!important;\n"
" line-height:30px!important}\n"
"table[class=video-content-padding-height], td[class=video-content-padding-height]\n"
" {height:45px!important}\n"
"td[class=avatar-size], img[class=avatar-size]\n"
" {width:54px!important;\n"
" height:54px!important}\n"
"img[class=large-avatar-size]\n"
" {width:32px!important}\n"
"img[class=channel-avatar-size]\n"
" {width:80px!important;\n"
" height:80px!important}\n"
"table[class=more-videos-size]\n"
" {height:100px!important}\n"
"div[class=more-videos-font], td[class=more-videos-font]\n"
" {font-size:24px!important;\n"
" line-height:27px!important}\n"
"table[class=more-videos-button-size]\n"
" {width:230px!important;\n"
" height:60px!important}\n"
"td[class=more-videos-button-width]\n"
" {width:250px!important}\n"
"td[class=more-videos-text-width]\n"
" {width:270px!important}\n"
"table[class=video-spotlight-width]\n"
" {width:600px!important;\n"
" height:332px!important}\n"
"td[class=video-spotlight-size], img[class=video-spotlight-size]\n"
" {width:600px!important;\n"
" height:332px!important}\n"
"table[class=regular-button-height]\n"
" {height:60px!important}\n"
"td[class=regular-button-padding-width]\n"
" {width:20px!important}\n"
"td[class=regular-button-font]\n"
" {font-size:27.5px!important;\n"
" line-height:27.5px!important}\n"
"img[class=play-button-img-size]\n"
" {width:20px!important;\n"
" height:20px!important}\n"
"table[class=large-button-size]\n"
" {width:600px!important;\n"
" height:70px!important}\n"
"table[class=video-2col-size]\n"
" {width:600px!important}\n"
"table[class=video-2col-width], td[class=video-2col-width]\n"
" {width:600px!important}\n"
"img[class=video-2col-thumb-size]\n"
" {width:600px!important;\n"
" height:332px!important}\n"
"table[class=video-2col-outer-container-size], td[class=video-2col-outer-container-size]\n"
" {width:600px!important}\n"
"table[class=video-2col-inner-container-size], td[class=video-2col-inner-container-size]\n"
" {width:540px!important}\n"
"table[class=video-2col-inner-container-width], td[class=video-2col-inner-container-width]\n"
" {width:540px!important}\n"
"div[class=section-title-font], td[class=section-title-font]\n"
" {font-size:30px!important;\n"
" line-height:35px!important}\n"
"div[class=section-subtitle-font], td[class=section-subtitle-font]\n"
" {font-size:25px!important;\n"
" line-height:25px!important}\n"
"table[class=video-3col-padding-height], td[class=video-3col-padding-height]\n"
" {height:55px!important}\n"
"img[class=video-3col-thumb-size], table[class=video-3col-thumb-size]\n"
" {width:600px!important;\n"
" height:332px!important}\n"
"table[class=video-3col-width], td[class=video-3col-width]\n"
" {width:600px!important}\n"
"table[class=inner-3col-content-container-width], td[class=inner-3col-content-container-width]\n"
" {width:600px!important}\n"
"td[class=small-pad-width]\n"
" {width:20px!important}\n"
"img[class=channel-avatar-size]\n"
" {width:80px!important;\n"
" height:80px!important}\n"
"img[class=thumbnail-size-class], td[class=thumbnail-size-class]\n"
" {width:80px!important;\n"
" height:44px!important}\n"
"span[class=follow-and-subs-font]\n"
" {display:block!important;\n"
" font-size:24px!important;\n"
" line-height:27px!important;\n"
" max-height:30px!important}\n"
"td[class=social-logo-padding-width]\n"
" {width:32px!important}\n"
"table[class=channel-owner-block-content-width], td[class=channel-owner-block-content-width]\n"
" {width:420px!important}\n"
"td[class=show-only-on-mobile]\n"
" {display:block!important;\n"
" width:100%!important;\n"
" max-height:100%!important;\n"
" overflow:visible!important}\n"
"td[class=show-not-on-mobile], tr[class=show-not-on-mobile]\n"
" {display:none!important;\n"
" visibility:hidden!important}\n"
"table, td\n"
" {width:500px!important}\n\n"
" }\n"
"-->\n"
"</style></head><body class=\"suppress-border-on-mobile\"><span style=\"display:none!important; visibility:hidden; width:0; height:0; opacity:0; color:transparent\">En directo en YouTube: AstridSofficialVEVO - Astrid S - Dance Dance Dance (Official Music Video).</span> <table class=\"outer-container-width\" width=\"680\" bgcolor=\"transparent\" align=\"center\" valign=\"top\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr><td class=\"outer-container-padding-width\" width=\"40\"></td><td class=\"inner-container-width\" width=\"600\"><table class=\"inner-container-width\" width=\"600\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr><td><table class=\"header-container-width\" width=\"600\" align=\"left\" valign=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr><td class=\"logo_container_size\" width=\"584\" valign=\"center\"><a href=\"https://www.youtube.com/attribution_link?a=IGCom2KEH-lFJgHW&u=/\"><img alt=\"Youtube Logo\" class=\"header_logo_size\" height=\"30\" src=\"http://www.gstatic.com/youtube/img/branding/youtubelogo/1x/youtubelogo_60.png\" border=\"0\" style=\"display:block\"></a> </td></tr></tbody></table></td></tr><tr><td style=\"max-height:0px; font-size:0; display:none\"><hr class=\"inner-container-width\" width=\"600\" style=\"height:0px; border:none; border-color:transparent; padding:0px; margin:0px\"></td></tr><tr><td class=\"large-section-padding-height\" height=\"20\"></td></tr><tr><td><table class=\"inner-container-width\" width=\"600\" align=\"center\" valign=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr><td><table class=\"video-spotlight-width\" width=\"600\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr style=\"\"><td colspan=\"3\"><a href=\"https://www.youtube.com/attribution_link?a=IGCom2KEH-lFJgHW&u=/watch%3Fv%3DW0ToDn9jXW8%26feature%3Dem-lsp\" class=\"nonplayable\" style=\"text-decoration:none; display:block\"><table aria-label=\"Astrid S - Dance Dance Dance (Official Music Video)\" class=\"video-spotlight-width\" width=\"600\" align=\"center\" background=\"http://i.ytimg.com/vi/W0ToDn9jXW8/sddefault.jpg?sqp=-oaymwEGCIAFEOgC&rs=AMzJL3m-iY1ZW8EiY3QwRalAMfq3atBT-Q&feature=em-lsp\" height=\"338\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"background-repeat:no-repeat; background-size:cover; background-position:center\"><tbody><tr style=\"\"><td aria-label=\"Astrid S - Dance Dance Dance (Official Music Video)\"><img src=\"https://www.gstatic.com/youtube/img/email/transparent_pixel.png\" alt=\"Astrid S - Dance Dance Dance (Official Music Video)\" width=\"600\" style=\"max-height:300px\"> </td></tr><tr aria-label=\"Astrid S - Dance Dance Dance (Official Music Video)\" scope=\"row\" style=\"\"><td aria-label=\"Astrid S - Dance Dance Dance (Official Music Video)\" class=\"footer-font\" valign=\"bottom\" width=\"600\" style=\"color:#fff; text-align:right; font-size:12px\"><div style=\"margin-bottom:8px; margin-right:8px; border-radius:2px; background-color:#E62117; padding:2px 4px; display:inline-block\">PREMIERE</div></td></tr></tbody></table></a></td></tr><tr><td><table class=\"large-section-padding-height\" height=\"16\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr><td class=\"large-section-padding-height\" height=\"16\"></td></tr></tbody></table></td></tr><tr><td><table class=\"content-container-width\" width=\"560\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"table-layout:fixed\"><tbody><tr><td class=\"avatar-size\" width=\"32\" style=\"vertical-align:top\"><a href=\"\"><img class=\"avatar-size\" src=\"https://lh6.googleusercontent.com/-YdGE1ZRP_7k/AAAAAAAAAAI/AAAAAAAAAAA/lTcGNRWN4cc/s88-c-mo/photo.jpg\" width=\"32\" border=\"0\" style=\"display:block; border-radius:50%\"> </a></td><td class=\"small-pad-width\" width=\"16\"></td><td><table class=\"content-container-width\" width=\"540\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"table-layout:fixed\"><tbody><tr><td valign=\"center\"><table class=\"content-container-width\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"table-layout:fixed\"><tbody><tr><td style=\"padding-bottom:4px\"><a href=\"https://www.youtube.com/attribution_link?a=IGCom2KEH-lFJgHW&u=/watch%3Fv%3DW0ToDn9jXW8%26feature%3Dem-lsp\" style=\"text-decoration:none\"><span class=\"video-title-font-class\" valign=\"center\" style=\"font-family:Roboto,sans-serif; font-size:14px; color:#212121; line-height:20px\">Astrid S - Dance Dance Dance (Official Music Video) </span></a></td></tr><tr><td><a class=\"video-link-font-class\" href=\"https://www.youtube.com/attribution_link?a=IGCom2KEH-lFJgHW&u=/user/AstridSofficialVEVO%3Ffeature%3Dhttp://www.youtube.com/user/AstridSofficialVEVO%253Ffeature%253Dem-lsp\" style=\"font-family:Roboto,sans-serif; font-size:12px; color:#757575; line-height:16px; letter-spacing:0px; text-decoration:none\">AstridSofficialVEVO </a></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td><table class=\"large-section-padding-height\" height=\"16\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr><td class=\"large-section-padding-height\" height=\"16\"></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><hr style=\"display:block; height:1px; border:0; border-top:1px solid #eaeaea; margin-bottom:16px; padding:0\"><tr><td><table class=\"inner-container-width\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr><td class=\"footer-font\" style=\"color:#757575; font-size:12px; line-height:16px; font-family:Roboto,sans-serif; letter-spacing:0px; word-wrap:break-word\">Te hemos enviado este correo electrónico porque querías recibir las novedades de <a href=\"https://www.youtube.com/attribution_link?a=IGCom2KEH-lFJgHW&u=/user/AstridSofficialVEVO%3Ffeature%3Dhttp://www.youtube.com/user/AstridSofficialVEVO%253Ffeature%253Dem-lsp\" style=\"text-decoration:none; color:#065FD4\">AstridSofficialVEVO</a>. Si quieres dejar de recibirlas, puedes <a href=\"https://www.youtube.com/attribution_link?noapp=1&a=IGCom2KEH-lFJgHW&u=/channel_updates_unsubscribe%3Fuid%3DXjBfPpnEmlhjuQFdvbsPkQ%26channel_id%3DUCkZc1mlptb_EI3n9kYUGgEA%26token%3DJ_uooufy6Em7wS-ZRVEt5RlBOsF8MTU5MTQ1OTIxOEAxNTkxNDU5MjE4%26feature%3Dem-lsp\" style=\"text-decoration:none; color:#065FD4\">cancelar tu suscripción aquí</a>. </td></tr><tr><td><table class=\"footer-content-padding-height\" height=\"16\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr><td class=\"footer-content-padding-height\" height=\"16\"></td></tr></tbody></table></td></tr><tr><td class=\"footer-font\" style=\"color:#757575; font-size:12px; line-height:16px; font-family:Roboto,sans-serif; letter-spacing:0px; text-decoration:none\">© 2020 YouTube, LLC 901 Cherry Ave, San Bruno, CA 94066 </td></tr><tr><td><table class=\"footer-content-padding-height\" height=\"16\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody><tr><td class=\"footer-content-padding-height\" height=\"16\"></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td><td class=\"outer-container-padding-width\" width=\"40\"></td></tr><tr><td colspan=\"3\"><table class=\"content-container-width\" width=\"600\" height=\"18\" align=\"left\" height=\"332\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"background-repeat:no-repeat; background-size:100% 100%\"><tbody><tr><td class=\"outer-container-padding-width\" width=\"40\"></td><td width=\"20\" aria-label=\"YouTube Link\"><a href=\"https://www.youtube.com/attribution_link?a=IGCom2KEH-lFJgHW&u=/youtube\" target=\"_blank\"><img alt=\"YouTube\" class=\"large-avatar-size\" src=\"https://www.gstatic.com/youtube/img/email/youtube_email_icon_grey.png\" height=\"18\" border=\"0\"> </a></td><td class=\"social-logo-padding-width\" width=\"16\"></td><td aria-label=\"Twitter Link\"><a href=\"https://twitter.com/YouTube\" target=\"_blank\"><img alt=\"Twitter\" class=\"large-avatar-size\" src=\"https://www.gstatic.com/youtube/img/email/twitter_email_icon_grey.png\" height=\"18\" border=\"0\"> </a></td></tr></tbody></table></td></tr></tbody></table><img class=\"open_tracking_img\" src=\"https://www.youtube.com/attribution_link?a=IGCom2KEH-lFJgHW&u=/gen_204%3Fa%3D\" width=\"1\" height=\"1\" style=\"display:none!important; visibility:hidden; width:0; height:0; opacity:0; color:transparent\"> </body></html>")
matches = re.finditer(regex, test_str, re.MULTILINE)
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