Regular Expressions 101

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression
No Match

r"
"
gm

Test String

Code Generator

Generated Code

# coding=utf8 # the above tag defines encoding for this document and is for Python 2.x compatibility import re regex = r"<a href=\"(.+?)\">\n.+?\n.+?\n.+?\n.+?\n.+?\n.+?h4>(.+?)<.+?\n.+?\n.+?\n.+?\n.+?\n.+?score\">(.+?)<.+?\n.+?\n.+?status\">(.+?)<.+?\n.+?\n.+?\n.+?\n.+?\n.+?\n.+?h4>(.+?)<" test_str = ("\n\n" "<html class=\"v2\" dir=\"ltr\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:b=\"http://www.google.com/2005/gml/b\" xmlns:data=\"http://www.google.com/2005/gml/data\" xmlns:expr=\"http://www.google.com/2005/gml/expr\"><head>\n" "<title> OVOSTREAMS - HOME PAGE</title>\n" "<link rel=\"icon\" href=\"/image/favicon.ico\" type=\"image/x-icon\"/>\n" "<link href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n" "<style type=\"text/css\">\n" "<!--\n" "/* ######## Reset Css ######################### */\n" ".section {\n" "margin:0;\n" "}\n" ".widget {\n" "margin:0;\n" "}\n" "ul, li, ol, p {\n" "padding:0;\n" "margin:0;\n" "}\n" ".navbar, .Attribution, h2.date-header, h4.date-header, .feed-links {\n" "height:0 !important;\n" "opacity:0;\n" "display:none;\n" "visibility:hidden;\n" "}\n" "img {\n" "max-width:100%;\n" "vertical:align:middle;\n" "}\n" "a {\n" "text-decoration: none;\n" "color: #000;\n" "}\n" "/* ######## Body Css ######################### */\n" "body {\n" "background: #e4e0db;\n" "font-family: 'Open Sans', sans-serif;\n" "}\n" "span.widget-item-control {\n" "display: none;\n" "}\n" "#puremag-outter {\n" "background-image: url(https://2.bp.blogspot.com/-5FmmDZlh1Tg/XSv5VrkCf-I/AAAAAAAABFI/9CJTw7MNhYMcSTRvDgElHa1KOEtqiDXCACLcBGAs/s1600/background.png);\n" "background-position: left top;\n" "background-size: auto;\n" "background-repeat: repeat;\n" "background-attachment: fixed;\n" "}\n" "/* ######## Main-Header Css ######################### */\n" "#main-header {\n" "padding: 15px 0;\n" "width: 1103px;\n" "margin: 0 auto;\n" "overflow: hidden;\n" "box-sizing: border-box;\n" "}\n" ".left-header {\n" "display: inline-block;\n" "float: left;\n" "padding: 15px 0px 0px 0px;\n" "}\n" ".left-header h1 {\n" "font-size: 16px;\n" "}\n" ".Header .description {\n" "margin-top: -5px;\n" "font-weight: bold;\n" "font-family: 'Frank Ruhl Libre',Arial,sans-serif;\n" "color: #000000;\n" "margin-left: 32px; \n" "}\n" ".right-header {\n" "display: inline-block;\n" "float: right;\n" "}\n" "#main-header h1 {\n" "font-family: 'Frank Ruhl Libre', serif;\n" "margin-bottom: 10px;\n" "font-size: 28px;\n" "font-weight: bold;\n" "color: #8c2828;\n" "}\n" ".item #main-header a {\n" "color: #8c2828;\n" "}\n" "/* ######## Menu Css ######################### */\n" "#menu {\n" "color: #FFF;\n" "text-align: left;\n" "margin: 0 auto;\n" "width: 1103px;\n" "height: 45px;\n" "background: #ffffff;\n" "border: 1px solid rgba(0,0,0,.2);\n" "}\n" "#menu ul,#menu li{margin:0 auto;padding:0 0;list-style:none}\n" "#menu ul {\n" "height: 45px;\n" "display: inline-block;\n" "}\n" "#menu ul li > a {\n" "border-right: 1px solid #dddddd;\n" "}\n" "#menu li{float:left;display:inline;position:relative;font:bold 0.9em Arial;}\n" "#menu a {\n" "letter-spacing: 0.5px;\n" "font-weight: normal;\n" "color: #333333;\n" "text-transform: uppercase;\n" "display: block;\n" "text-align: left;\n" "line-height: 45px;\n" "padding: 0 11px;\n" "text-decoration: none;\n" "font-size: 13px;\n" "font-family: 'Oswald', sans-serif;\n" "}\n" "#menu li a:hover{\n" "background:#000000;\n" "color: #fff;\n" "-webkit-transition: all .1s ease-in-out;\n" "-moz-transition: all .1s ease-in-out;\n" "-ms-transition: all .1s ease-in-out;\n" "-o-transition: all .1s ease-in-out;\n" "transition: all .1s ease-in-out;\n" "}\n" "#menu input{display:none;margin:0 0;padding:0 0;width:80px;height:55px;opacity:0;cursor:pointer}\n" "#menu label{font:bold 30px Arial;display:none;width:45px;height:55px;line-height:55px;text-align:center}\n" "#menu label span{font-size:16px;position:absolute;left:35px}\n" "#menu ul li ul{\n" "height: auto;\n" "background:#fff;\n" "width: 180px;\n" "left:0px;\n" "position: absolute;\n" "z-index: 99;\n" "display:none;\n" "}\n" "#menu ul li ul li ul {\n" "top:0px;\n" "left:180px;\n" "position: absolute;\n" "z-index: 99;\n" "visibility:hidden;\n" "}\n" "#menu ul.menus li{\n" "display: block;\n" "width: 100%;\n" "font:normal 0.8em Arial;\n" "text-transform: none;\n" "text-shadow: none;\n" "}\n" "#menu ul.menus a{\n" "color: #333333;\n" "font-size: 13px;\n" "font-family: 'Oswald', sans-serif;\n" "line-height: 35px;\n" "}\n" "#menu ul > li:hover ul{\n" "display:block;\n" "}\n" "#menu ul > li > ul > li:hover ul{\n" "display:block;\n" "visibility:visible;\n" "}\n" "#menu ul.menus a:hover{\n" "background-color: #000000;\n" "color: #fff;\n" "-webkit-transition: all .1s ease-in-out;\n" "-moz-transition: all .1s ease-in-out;\n" "-ms-transition: all .1s ease-in-out;\n" "-o-transition: all .1s ease-in-out;\n" "transition: all .1s ease-in-out;\n" "}\n" "/* ######## Main-post Css ######################### */\n" "#content-wrap {\n" "width: 1103px;\n" "margin: 20px auto;\n" "box-sizing: border-box;\n" "overflow: hidden;\n" "}\n" ".main-post {\n" "width: 66%;\n" "float:left;\n" "background:#fff;\n" "border: 1px solid rgba(0,0,0,.2);\n" "}\n" ".sidebar {\n" "width: 32%;\n" "float: right;\n" "}\n" ".post {\n" "box-sizing: border-box;\n" "padding: 15px 15px 8px;\n" "background: #fff;\n" "}\n" ".block-image {\n" "width: 47%;\n" "margin-right: 3%;\n" "float: left;\n" "}\n" ".thumb img {\n" "width: 100%;\n" "object-fit: cover;\n" "height: 240px;\n" "}\n" ".thumb {\n" "width:100%;\n" "height:240px;\n" "}\n" ".post-footer {\n" "display: none;\n" "}\n" ".read-text {\n" "display: inline-block;\n" "}\n" ".index .post-labels a {\n" "display: inline-block;\n" "color: #ffffff !important;\n" "background: #8c2828 !important;\n" "padding: 3px 5px;\n" "font: normal normal 12px Oswald;\n" "line-height: 1;\n" "margin: 0 5px 2px 0;\n" "text-transform: uppercase;\n" "letter-spacing: 0.5px;\n" "}\n" "h2.post-title.entry-title a {\n" "color: #000000 !important;\n" "line-height: 1.2;\n" "font-family: 'Oswald', sans-serif;\n" "text-transform: none;\n" "font-weight: 300;\n" "letter-spacing: 0.5px;\n" "}\n" "h2.post-title.entry-title {\n" "margin: 7px 0 7px 0;\n" "}\n" ".comment-post {\n" "display: inline-block;\n" "}\n" ".meta-post {\n" "margin: 0 0 6px 0;\n" "}\n" "span.meta-date:before {\n" "content: '\\2022';\n" "color: #666666\n" "}\n" ".comment-post:before {\n" "content: '\\2022';\n" "color: #666666\n" "}\n" ".meta-post span,.meta-post a {\n" "color: #666666 !important;\n" "font: normal normal 13px Oswald;\n" "text-transform: uppercase;\n" "display: inline-block;\n" "letter-spacing: 0.3px;\n" "}\n" "span.meta-date {\n" "margin: 0 5px;\n" "}\n" "abbr.published {\n" "text-decoration: none;\n" "}\n" "a.read-more {\n" "display: inline-block;\n" "background: #333333 !important;\n" "color: #ffffff !important;\n" "padding: 5px 10px;\n" "font: normal normal 13px Oswald,Arial,Helvetica,sans-serif;\n" "text-transform: uppercase;\n" "}\n" ".read-text {\n" "display: inline-block;\n" "margin: 5px 0 0 0;\n" "}\n" ".post-summary p {\n" "color: #555555;\n" "font: normal normal 14px Domine,Arial,Helvetica,sans-serif;\n" "line-height: 1.6;\n" "text-align: justify;\n" "margin-bottom: 10px;\n" "}\n" ".post-summary {\n" "display:block;\n" "padding-top: 0px;\n" "margin-bottom:10px;\n" "}\n" "#blog-pager-newer-link:before {\n" "content: \"\\f177\";\n" "font-size: 13px;\n" "margin-right: 5px;\n" "color: #C90000;\n" "font-family: fontawesome;\n" "}\n" "#blog-pager-newer-link {\n" "font-family: Domine,Arial,sans-serif;\n" "font-size: 14px;\n" "line-height: 1.6;\n" "}\n" "#blog-pager-newer-link a {\n" "color: #8c2828;\n" "}\n" "/* ######## Social Sharing Widget ######################### */\n" ".share-box {\n" "position: relative;\n" "padding: 10px;\n" "}\n" ".share-title {\n" "border-bottom: 2px solid #777;\n" "color: #010101;\n" "display: inline-block;\n" "padding-bottom: 7px;\n" "font-size: 15px;\n" "font-weight: 500;\n" "position: relative;\n" "top: 2px;\n" "}\n" ".share-art {\n" "float: right;\n" "padding: 0;\n" "padding-top: 0;\n" "font-size: 13px;\n" "font-weight: 400;\n" "text-transform: capitalize;\n" "}\n" ".share-art a {\n" "color: #fff;\n" "padding: 3px 8px;\n" "margin-left: 4px;\n" "border-radius: 2px;\n" "display: inline-block;\n" "margin-right: 0;\n" "background: #010101;\n" "}\n" ".share-art a span {\n" "display: none;\n" "}\n" ".share-art a:hover{color:#fff}\n" ".share-art .fac-art{background:#3b5998}\n" ".share-art .fac-art:hover{background:rgba(49,77,145,0.7)}\n" ".share-art .twi-art{background:#00acee}\n" ".share-art .twi-art:hover{background:rgba(7,190,237,0.7)}\n" ".share-art .goo-art{background:#db4a39}\n" ".share-art .goo-art:hover{background:rgba(221,75,56,0.7)}\n" ".share-art .pin-art{background:#CA2127}\n" ".share-art .pin-art:hover{background:rgba(202,33,39,0.7)}\n" ".share-art .lin-art{background:#0077B5}\n" ".share-art .lin-art:hover{background:rgba(0,119,181,0.7)}\n" ".share-art .wat-art{background:#25d266;display:none;}\n" ".share-art .wat-art:hover{background:rgba(37, 210, 102, 0.73)}\n" "@media only screen and (max-width: 768px) {\n" ".share-art .wat-art{display:inline-block;}\n" "}\n" "/* ######## Side-bar Css ######################### */\n" ".sidebar .widget {\n" "background: #ffffff;\n" "position: relative;\n" "padding: 15px;\n" "margin-bottom: 30px;\n" "word-break: normal;\n" "word-wrap: break-word;\n" "overflow: hidden;\n" "border: 1px solid rgba(0,0,0,.2);\n" "}\n" ".sidebar h2 {\n" "font: normal normal 16px Oswald,Arial,Helvetica,sans-serif;\n" "line-height: 1;\n" "color: #686868;\n" "margin: -15px -15px 15px -15px;\n" "padding: 10px 0;\n" "text-transform: uppercase;\n" "text-align: center;\n" "border-bottom: 1px solid #dfdfdf;\n" "}\n" ".sidebar .popular-posts ul li {\n" "line-height:1.4;\n" "margin: 0;\n" "padding: 8px 0px 8px 0px;\n" "border-bottom: 1px solid #eeeeee;\n" "list-style-type:none;\n" "}\n" ".sidebar .popular-posts ul {\n" "margin:0px;\n" "padding:0px;\n" "}\n" ".sidebar .popular-posts ul li a {\n" "text-transform: capitalize;\n" "letter-spacing: 0.5px;\n" "color: #313131;\n" "line-height: 1.6;\n" "font-size: 14px;\n" "font-family: Domine,Arial,sans-serif;\n" "}\n" ".label-size a {\n" "letter-spacing:0.5;\n" "font-size: 14px;\n" "font-family: Domine,Arial,sans-serif;\n" "float:left;\n" "display: inline-block;\n" "color: #ffffff !important;\n" "background: #888888 !important;\n" "border: 0px solid #cccccc;\n" "padding: 3px 5px;\n" "margin: 0 10px 8px 0;\n" "text-decoration: none;\n" "line-height: 1;\n" "-webkit-transition: .2s ease-in;\n" "-moz-transition: .2s ease-in;\n" "-o-transition: .2s ease-in;\n" "transition: .2s ease-in;\n" "text-shadow: none !important;\n" "}\n" "/* ######## Footer Css ######################### */\n" "#multifooter-wrap {\n" "box-shadow: 0 0 2px #000000;\n" "position: relative;\n" "margin: 0 auto;\n" "padding: 10px 0;\n" "background: #252525;\n" "color: #cecece;\n" "word-wrap: break-word;\n" "}\n" "#multi-footer {\n" "overflow:hidden;\n" "width: 1103px;\n" "margin: 0 auto;\n" "}\n" ".footer {\n" "float: left;\n" "width: 256px;\n" "padding: 20px 19px 0 0;\n" "margin: 0;\n" "}\n" ".footer:last-child {\n" "padding-left:0px;\n" "margin:0px;\n" "}\n" ".footer h2 {\n" "letter-spacing:0.3px;\n" "font: normal normal 16px Oswald,Arial,Helvetica,sans-serif;\n" "line-height: 1;\n" "margin: 0 0 15px;\n" "padding: 0 0 15px;\n" "color: #ffffff;\n" "text-transform: uppercase;\n" "border-bottom: 1px dotted #5A5656;\n" "}\n" ".footer .recent-post-title a {\n" "color: #dbdbdb;\n" "}\n" ".footer .popular-posts ul li a {\n" "text-transform: capitalize;\n" "letter-spacing: 0.5px;\n" "color: #dbdbdb;\n" "line-height: 1.6;\n" "font-size: 14px;\n" "font-family: Domine,Arial,sans-serif;\n" "}\n" ".footer .recent-post-title li {\n" "line-height: 25px;\n" "}\n" ".footer ul.recent-posts-container li {\n" "border-bottom: 1px solid #353232;\n" "line-height: 11.2px;\n" "}\n" ".footer .popular-posts ul li {\n" "list-style-type:none;\n" "border-bottom: 1px solid #353232;\n" "line-height: 25px;\n" "}\n" ".footer .popular-posts ul {\n" "margin:0px;\n" "padding:0px;\n" "}\n" ".footer .widget p {\n" "font-size: 14px;\n" "font-family: Domine,Arial,sans-serif;\n" "line-height: 1.6;\n" "text-align: justify;\n" "}\n" "#BlogArchive1_ArchiveMenu {\n" "width: 100%;\n" "color: #555555;\n" "border: 1px solid rgba(0,0,0,.2);\n" "padding: 5px 0px;\n" "font-family: Domine,Arial,sans-serif;\n" "}\n" "#credit-footer {\n" "width: 100%;\n" "box-shadow: 0 0 2px #000000;\n" "background: #303436;\n" "margin: 0 auto;\n" "border-top: 1px solid #3D3D3D;\n" "text-align: center;\n" "}\n" ".copyright {\n" "padding: 25px 0;\n" "}\n" ".copyright p,.copyright a {\n" "color: #ECFFF1;\n" "font: normal normal 13px Domine,Arial,Helvetica,sans-serif;\n" "}\n" "a.home-link {\n" "display: none;\n" "}\n" "#blog-pager-older-link {\n" "float: none;\n" "font-family: Domine,Arial,sans-serif;\n" "font-size: 14px;\n" "line-height: 1.6;\n" "}\n" "#blog-pager-older-link a:after {\n" "content: \"\\f178\";\n" "font-size: 13px;\n" "margin-left: 5px;\n" "color: #C90000;\n" "font-family: fontawesome;\n" "}\n" "#blog-pager-older-link a {\n" "color:#8c2828;\n" "}\n" "#blog-pager {\n" "margin: 1em 0;\n" "text-align: right;\n" "overflow: hidden;\n" "padding: 0 12px;\n" "}\n" "/* ######## Post Css ######################### */\n" ".item .post-labels {\n" "margin: -15px -15px 6px -15px !important;\n" "padding: 10px 15px !important;\n" "border-bottom: 1px dotted #ddd;\n" "display: block;\n" "text-align: center;\n" "}\n" ".item .post-labels a {\n" "letter-spacing: 0.3px;\n" "color: #666666;\n" "font: normal normal 12px Oswald,Arial,Helvetica,sans-serif;\n" "text-transform: uppercase;\n" "}\n" ".item .post-labels a:before {\n" "content: \"\\f115\";\n" "font-family:fontawesome;\n" "margin-right:3px;\n" "}\n" ".item h1.post-title.entry-title {\n" "text-align: center;\n" "}\n" ".item h1.post-title.entry-title {\n" "margin-bottom: 10px;\n" "color: #000000 !important;\n" "line-height: 1.2;\n" "font-family: 'Oswald', sans-serif;\n" "text-transform: none;\n" "font-weight: 300;\n" "letter-spacing: 0.5px;\n" "}\n" ".item .meta-post {\n" "text-align: center;\n" "}\n" ".item span.meta-author:before {\n" "content: \"\\f2be\";\n" "font-size: 12px;\n" "font-family:fontawesome;\n" "margin-right:3px;\n" "}\n" ".item span.meta-date:before {\n" "content: \"\\f017\";\n" "font-size: 12px;\n" "font-family:fontawesome;\n" "margin-right:3px;\n" "}\n" ".item .comment-post:before {\n" "content: \"\\f0e6\";\n" "font-size: 12px;\n" "font-family:fontawesome;\n" "margin-right:3px;\n" "}\n" ".item .post-body {\n" "color: #555555;\n" "line-height: 1.7;\n" "font-family: Domine,Arial,sans-serif;\n" "font-size: 14px;\n" "}\n" ".item a.home-link {\n" "font-family: Domine,Arial,sans-serif;\n" "font-size: 14px;\n" "line-height: 1.6;\n" "color: #8c2828;\n" "display: -webkit-inline-box;\n" "float: left;\n" "}\n" ".item a.home-link:before {\n" "content: \"\\f177\";\n" "font-size: 13px;\n" "margin-right: 5px;\n" "color: #C90000;\n" "font-family: fontawesome;\n" "}\n" "/* ######## Comment Css ######################### */\n" ".comments .comments-content .comment:first-child {\n" "overflow: hidden;\n" "border: 1px solid #eaeaea;\n" "margin: 12px 12px 20px 12px;\n" "padding: 15px;\n" "background: #f5f5f5;\n" "}\n" ".comments .comments-content .user {\n" "font-style: normal;\n" "display: -webkit-box;\n" "font-weight: bold;\n" "}\n" ".comments .comments-content .user a {\n" "font: normal normal 13px Domine, Arial, Helvetica, Sans-serif;\n" "line-height: 1.6;\n" "color: #555555;\n" "font-weight: 700;\n" "}\n" ".comments .comments-content .comment:last-child {\n" "border: 1px solid #eaeaea;\n" "margin: 12px 12px 20px 12px;\n" "padding: 15px;\n" "background: #f5f5f5;\n" "}\n" ".comments .comments-content .comment:first-child {\n" "border: 1px solid #eaeaea;\n" "margin: 12px 12px 20px 12px;\n" "padding: 15px;\n" "background: #f5f5f5;\n" "}\n" ".comments .comments-content .icon.blog-author {\n" "display: none;\n" "margin: 0px;\n" "}\n" ".comments .comments-content .comment-content {\n" "color: #161514;\n" "font-family: Domine,Arial,sans-serif;\n" "font-size: 14px;\n" "line-height: 1.6;\n" "text-align: justify;\n" "}\n" ".comments .comments-content .datetime a {\n" "color: #C90000;\n" "margin-left: 0;\n" "font: normal normal 13px Domine, Arial, Helvetica, Sans-serif;\n" "line-height: 1.6;\n" "text-decoration: none;\n" "outline: none;\n" "}\n" ".comments .comments-content .datetime {\n" "margin:0px;\n" "}\n" ".comments .comment-block {\n" "margin-left: 0px;\n" "position: relative;\n" "}\n" ".comments .avatar-image-container {\n" "float: left;\n" "max-height: 36px;\n" "margin-right: 10px;\n" "overflow: hidden;\n" "width: 36px;\n" "}\n" "span.blog-admin, span.pid-353262945 {\n" "display: inline;\n" "float: right;\n" "}\n" ".comments .comment .comment-actions a {\n" "padding-right: 5px;\n" "font: normal normal 14px Domine, Arial, Helvetica, Sans-serif;\n" "line-height: 1.6;\n" "font-style: italic;\n" "color: #C90000;\n" "text-decoration: none;\n" "outline: none;\n" "padding-top: 5px;\n" "}\n" ".comments .comment .comment-actions a:hover {\n" "color:#000000;\n" "text-decoration:none;\n" "}\n" "#comments h4 {\n" "color: #444;\n" "font: normal normal 13px Domine, Arial, Helvetica, Sans-serif;\n" "line-height: 1.6;\n" "padding: 0em 1em;\n" "text-transform:uppercase;\n" "text-decoration: none;\n" "outline: none;\n" "}\n" "color: #444;\n" "font: normal normal 13px Domine, Arial, Helvetica, Sans-serif;\n" "line-height: 1.6;\n" "text-decoration: none;\n" "outline: none;\n" "}\n" ".comments .comments-content .comment-replies {\n" "margin-left: 0px;\n" "margin-top: 0em;\n" "}\n" ".comments .continue a {\n" "bottom: 590px;\n" "padding-left: 28px;\n" "position: absolute;\n" "font: normal normal 14px Domine, Arial, Helvetica, Sans-serif;\n" "line-height: 1.6;\n" "font-style: italic;\n" "/* color: #444; */\n" "color: #C90000;\n" "display: inline-block;\n" "font-size: 14px;\n" "}\n" ".comments .comments-content .comment {\n" "border: 1px solid #eaeaea;\n" "margin: 12px 12px 20px 12px;\n" "padding: 15px;\n" "background: #f5f5f5;\n" "margin-bottom: 16px;\n" "padding-bottom: 8px;\n" "}\n" "/* ######## Contact Form Widget By Sorabloggingtips.com ######################### */\n" ".contact-form-name, .contact-form-email, .contact-form-email-message, .contact-form-widget {\n" "max-width: none;\n" "}\n" ".contact-form-name, .contact-form-email, .contact-form-email-message {\n" "background-color: #EBEBEB;\n" "border: 1px solid #ccc;\n" "}\n" ".contact-form-widget .form {\n" "}\n" ".contact-form-button-submit {\n" "max-width: none;\n" "width: 100%;\n" "height: 35px;\n" "border:0;\n" "background-image: none;\n" "background-color: #8c2828 !important;\n" "cursor: pointer;\n" "font-style: normal;\n" "font-weight: 400;\n" "}\n" ".contact-form-name:focus, .contact-form-email:focus, .contact-form-email-message:focus {\n" "border: 0;\n" "box-shadow: none;\n" "}\n" ".contact-form-name:hover, .contact-form-email:hover, .contact-form-email-message:hover {\n" "border: 0;\n" "}\n" ".contact-form-button-submit:hover {\n" "background-color: #303030;\n" "background-image: none;\n" "border: 0;\n" "}\n" "/* ######## 404-page Css ######################### */\n" "body.error_page .feat-slider-wrap {\n" "display:none;\n" "}\n" "body.error_page .sidebar {\n" "display:none;\n" "}\n" "body.error_page .main-post {\n" "width: 100%;\n" "float: left;\n" "}\n" ".status-msg-wrap {\n" "font-size: 100%;\n" "margin: none;\n" "position: static;\n" "width: 100%;\n" "}\n" ".status-msg-border {\n" "display:none\n" "}\n" ".status-msg-body {\n" "padding: none;\n" "position: static;\n" "text-align: inherit;\n" "width: 100%;\n" "z-index: auto;\n" "}\n" ".status-msg-wrap a {\n" "padding: none;\n" "text-decoration: inherit;\n" "}\n" ".BB-404-box {\n" "background:#FFFFFF;\n" "width:98%;\n" "margin:10px 0px;\n" "padding:20px 10px;\n" "border:1px solid #ddd;\n" "-moz-border-radius:6px;\n" "-webkit-border-radius:6px;\n" "border-radius:6px;\n" "box-shadow: 5px 5px 5px #CCCCCC;\n" "}\n" "/* ######## Static-page Css ######################### */\n" ".static_page .meta-post {\n" "display: none;\n" "}\n" ".static_page h1.post-title.entry-title {\n" "margin-bottom: 10px;\n" "text-transform: uppercase;\n" "font: normal normal 28px 'Playfair Display',Arial,Helvetica,sans-serif;\n" "color: #000000 !important;\n" "line-height: 1.2;\n" "letter-spacing: 0.5px;\n" "}\n" ".static_page .post-body {\n" "color: #555555;\n" "line-height: 1.7;\n" "font-family: Domine,Arial,sans-serif;\n" "font-size: 15px;\n" "}\n" "/* ######## Author Widget By Sorabloggingtips.com ######################### */\n" ".sora-author-box {\n" "border: 1px solid #f2f2f2;\n" "background: #f8f8f8;\n" "overflow: hidden;\n" "padding: 10px;\n" "margin: 10px 0;\n" "}\n" ".sora-author-box img {\n" "float: left;\n" "margin-right: 10px;\n" "border-radius: 50%;\n" "}\n" ".sora-author-box p {\n" "padding: 10px;\n" "}\n" ".sora-author-box b {\n" "font-size: 20px;\n" "}\n\n" "--></style>\n" "<style id=\"template-skin-1\" type=\"text/css\"><!--\n" "body#layout {\n" "width:900px;\n" "}\n" "body#layout #main-header {\n" "width:900px;\n" "}\n" "body#layout .right-header {\n" "width: 450px;\n" "margin:0px;\n" "padding:0px;\n" "}\n" "body#layout .left-header {\n" "width: 450px;\n" "margin:0px;\n" "padding:0px;\n" "}\n" "body#layout .wrapper {\n" "width: 900px;\n" "margin:0px;\n" "padding:0px;\n" "}\n" "body#layout #header-wrap {\n" "width: 900px;\n" "padding: 0px;\n" "margin: 0;\n" "}\n" "body#layout .header-logo {\n" "width: 450px;\n" "display: inline-block;\n" "float: left;\n" "}\n" "body#layout .header-ads {\n" "width: 450px;\n" "display: inline-block;\n" "float: left;\n" "}\n" "body#layout #content-wrap {\n" "width: 900px;\n" "margin: 0;\n" "padding: 0px;\n" "overflow: hidden;\n" "}\n" "body#layout .main-post {\n" "width:450px;\n" "margin:0px;\n" "float:left;\n" "}\n" "body#layout .sidebar {\n" "width: 450px;\n" "float: right;\n" "margin:0px;\n" "padding:0px;\n" "}\n" "body#layout .navbar {\n" "display:block;\n" "}\n" "body#layout #lower-footer {\n" "width:900px;\n" "overflow:hidden;\n" "padding:0px;\n" "margin:0px;\n" "}\n" "body#layout div.section {\n" "background-color: #f8f8f8;\n" "border: 1px solid #ccc;\n" "font-family: Roboto, sans-serif;\n" "margin: 0 4px 8px 4px;\n" "overflow: visible;\n" "padding: 15px;\n" "position: relative;\n" "}\n" "body#layout div.layout-title {\n" "font-size: 16px;\n" "color: black;\n" "font-family: monospace;\n" "}\n" "body#layout .add_widget {\n" "border: 4px double black;\n" "padding: 16px;\n" "position: relative;\n" "text-align: left;\n" "background:pink;\n" "}\n" "body#layout .section h4 {\n" "font-size: 19px;\n" "line-height: 24px;\n" "margin: 2px 24px 8px 24px;\n" "text-align: center;\n" "font-family: monospace;\n" "color:red;\n" "}\n" "body#layout div.layout-widget-description {\n" "color: rgba(0,0,0,0.52);\n" "font-size: 14px;\n" "display: none;\n" "visibility: hidden;\n" "}\n" "body#layout .draggable-widget .widget-wrap2 {\n" "background: #9E9E9E url(/img/widgets/draggable.png) no-repeat 4px 50%;\n" "cursor: move;\n" "}\n" "body#layout #footer-wrap {\n" "width:800px;\n" "overflow:hidden;\n" "}\n" "body#layout .footer {\n" "width:225px;\n" "margin:0px;\n" "padding:0px;\n" "float:left;\n" "}\n" "body#layout #menu {\n" "display: none;\n" "}\n" "body#layout .social {\n" "display: none;\n" "}\n" "body#layout #combo-post .ext-post:last-child {\n" "margin-right:0px;\n" "}\n" "@media screen and (max-width: 800px){\n" "p.description {\n" "font-size: 15px;\n" "}\n" ".Header h1 {\n" "font-size:30px;\n" "}\n" "#body-wrapper {\n" "box-sizing: border-box;\n" "width: 90%;\n" "margin: 0 auto;\n" "}\n" ".wrapper {\n" "width: 100%;\n" "}\n" ".header-logo {\n" "float:none;\n" "display: block;\n" "text-align: center;\n" "}\n" ".search-bar {\n" "display:none;\n" "}\n" "#content-wrap {\n" "width:100%;\n" "}\n" ".post {\n" "width: 100%;\n" "margin-right: 12px;\n" "}\n" ".post-summary p {\n" "font-size: 13px;\n" "}\n" "h2.post-title.entry-title a, h1.post-title.entry-title {\n" "font-size: 22px;\n" "}\n" ".meta-post a, .meta-post p {\n" "font-size:13px;\n" "}\n" ".label p, .label a {\n" "font-size:13px;\n" "}\n" ".comment-post a {\n" "font-size:13px;\n" "}\n" "#blog-pager-older-link a {\n" "font-size: 13px;\n" "color: #C90000;\n" "}\n" ".sidebar .tt a {\n" "font-size:13px;\n" "}\n" ".footer .tt a {\n" "font-size:13px;\n" "}\n" ".sample-text p {\n" "font-size:13px;\n" "}\n" ".label-size a {\n" "font-size:13px;\n" "}\n" ".text-widget p {\n" "font-size:13px;\n" "}\n" "#copyright a {\n" "font-size:13px;\n" "}\n" "#copyright p {\n" "font-size:13px;\n" "}\n" ".popular-posts ul li a {\n" "font-size:13px;\n" "}\n" "a.read-more {\n" "font-size:13px;\n" "}\n" ".post-body {\n" "font-size: 13px;\n" "text-align: justify;\n" "}\n" ".main-post {\n" "width:100%;\n" "}\n" ".sidebar {\n" "padding: 0px;\n" "width: 100%;\n" "}\n" "#lower-footer {\n" "width: 100%;\n" "}\n" ".footer {\n" "width: 100%;\n" "}\n" "#menu ul.menus a {\n" "color: #161514;\n" "line-height: 35px;\n" "}\n" "#menu ul.menus li {\n" "text-align:left;\n" "display: block;\n" "width: 100%;\n" "font: normal 0.8em Arial;\n" "text-transform: none;\n" "text-shadow: none;\n" "}\n" "#menu{position:relative}\n" "#menu ul{background:#fff;position:absolute;top:100%;right:0;left:0;z-index:3;height:auto;display:none}\n" "#menu ul li ul, #menu ul li ul li ul{width:100%;position:static;padding-left:20px}\n" "#menu li{text-align:left;display:block;float:none;width:auto; font:normal 0.8em Arial;}\n" "#menu input, #menu label {\n" "width: 100%;\n" "position: absolute;\n" "top: 0;\n" "color: #111;\n" "background: #f5f5f5;\n" "left: 0px;\n" "display: block;\n" "}\n" "#menu ul li:hover li ul {\n" "display:none;\n" "}\n" "#menu input{z-index:4}\n" "#menu input:checked + label{color:black;}\n" "#menu input:checked ~ ul{display:block}\n" "#menu {\n" "color: #FFF;\n" "text-align: center;\n" "margin: 0 auto;\n" "width: 100%;\n" "height: 55px;\n" "border-top: 1px solid #eaeaea;\n" "border-bottom: 1px solid #eaeaea;\n" "}\n" "#menu a {\n" "letter-spacing: 0.2px;\n" "color: #161514;\n" "}\n" "#menu ul li ul {\n" "background:#fff;\n" "}\n" "}\n" "@media screen and (max-width: 500px){\n" ".recent-post-title a,.popular-posts ul li a {\n" "font-size:12px;\n" "}\n" ".footer h2 {\n" "font-size:14px;\n" "padding-left: 12px;\n" "letter-spacing: 0.2px;\n" "}\n" ".footer .widget p {\n" "font-size:14px;\n" "}\n" ".footer .popular-posts ul li,.footer ul.recent-posts-container li {\n" "padding-left: 12px;\n" "}\n" ".left-header {\n" "display: block;\n" "float: none;\n" "text-align: center;\n" "}\n" ".right-header {\n" "display: block;\n" "float: none;\n" "text-align: center;\n" "}\n" "#multi-footer {\n" "width:100%;\n" "}\n" ".block-image {\n" "width:100%;\n" "max-width: none;\n" "float:none;\n" "}\n" "span.post-labels {\n" "display: block;\n" "text-align: center;\n" "margin: 5px 0;\n" "}\n" ".meta-post a, .meta-post p {\n" "font-size: 12px;\n" "}\n" "h2.post-title.entry-title a, h1.post-title.entry-title {\n" "font-size: 20px;\n" "line-height: 24px;\n" "}\n" ".post-summary p {\n" "text-align: justify;\n" "font-size: 12px;\n" "line-height: 1.5;\n" "}\n" ".label p, .comment-post span {\n" "font-size: 12px;\n" "}\n" ".label a, .comment-post a {\n" "font-size:12px;\n" "}\n" ".mix {\n" "display:block;\n" "padding: 0px 10px;\n" "}\n" "h2.post-title.entry-title {\n" "text-align:center;\n" "margin-bottom: 10px;\n" "line-height: 22px;\n" "}\n" "#blog-pager-older-link a {\n" "font-size: 12px;\n" "}\n" ".post-body {\n" "font-size: 12px;\n" "}\n" ".sidebar .tt a {\n" "font-size:12px;\n" "}\n" ".footer .tt a {\n" "font-size:12px;\n" "}\n" ".sample-text p {\n" "font-size:12px;\n" "}\n" ".label-size a {\n" "font-size:12px;\n" "}\n" ".text-widget p {\n" "font-size:12px;\n" "}\n" "#copyright a {\n" "font-size:12px;\n" "}\n" "#copyright p {\n" "font-size:12px;\n" "}\n" ".popular-posts ul li a {\n" "font-size:12px;\n" "}\n" ".mixx {\n" "text-align: center;\n" "}\n" ".read-text {\n" "text-align: center;\n" "display: block;\n" "}\n" ".meta-post {\n" "display:none;\n" "padding: 3px 0px;\n" "}\n" "p.description {\n" "font-size: 13px;\n" "}\n" ".Header h1 {\n" "font-size:25px;\n" "}\n" "}\n" "@media screen and (max-width: 1024px){\n" "#puremag-outter {\n" "width:90%;\n" "margin: 0 auto;\n" "box-sizing: border-box;\n" "}\n" "#main-header {\n" "width:100%;\n" "}\n" "#menu {\n" "width:100%;\n" "}\n" ".main-post,.sidebar {\n" "width: 100%;\n" "}\n" ".sidebar h2 {\n" "text-align: left;\n" "padding: 10px 15px;\n" "}\n" ".footer .widget p {\n" "padding: 0 15px;\n" "}\n" ".left-header {\n" "display: block;\n" "float: none;\n" "text-align: center;\n" "}\n" ".right-header {\n" "display: block;\n" "float: none;\n" "text-align: center;\n" "}\n" "#content-wrap {\n" "width:100%;\n" "}\n" "#multifooter-wrap {\n" "width: 100%;\n" "}\n" "#multi-footer {\n" "width:100%;\n" "}\n" ".footer {\n" "width: 100%;\n" "}\n" ".footer ul.recent-posts-container li,.footer .popular-posts ul li {\n" "padding-left: 15px;\n" "}\n" ".footer h2 {\n" "padding-left: 15px;\n" "}\n" ".cloud-label-widget-content {\n" "padding-left: 15px;\n" "}\n" "}\n" ".main-post {\n" " background: none;\n" " border:none\n" " \n" "}\n" " .date {\n" " text-align: center;\n" " font-size: 20px !important;\n" " padding: 1rem !important;\n" "}\n" " .post{margin-bottom:1rem;\n" " padding: 0;}\n" " .match-view-headT{display:table;table-layout:fixed;width:95%;margin:auto}\n" " .match-view-head-side1,.match-view-head-side2{font-size:1.3em;font-weight:900;text-transform:uppercase;vertical-align:top;line-height:20px;padding-top:2px;letter-spacing:-.7px;word-wrap:break-word;text-align:center;position:relative}\n" " .match-view-head-side1,.match-view-head-side2,.match-view-headSS{display:table-cell}\n" " .event-team img{width:85px}\n" " .event-team h4{font-weight:800;color:#00222e}\n" " .match-view-headSS{text-align:center;vertical-align:middle;font-weight:600;line-height:30px}\n" " .match-view-headSS .score{min-width:36px;border-radius:10px;display:inline-block;padding:5px 0;min-height:42px;vertical-align:middle;margin:0 18px;font-size:18px;text-align:center}.event-status{margin:10px 0;font-size:16px}.match-view-headSS .start-time{font-size:2em;line-height:.6em;font-weight:300;color:#888;border-color:#eee;letter-spacing:0}.days-left{font-size:.8em;color:#c74a58;font-weight:700;margin-bottom:8px}.goal-incidents{padding:0;list-style:none}.goal-incidents li{padding-top:5px;padding-bottom:5px;color:#3a0115;position:relative;font-weight:400;vertical-align:middle;line-height:15px;min-height:15px;font-size:1.1em;cursor:pointer;margin-top:6px}.side1{text-align:right;margin-right:50%;padding-right:46px}.side2{text-align:left;margin-left:50%;padding-left:46px}.sidestatus{position:absolute;top:3px;width:60px;text-align:center;color:#3a0115;font-weight:400;line-height:20px;right:-24px}.side2 .sidestatus{left:-35px}\n" "--></style>\n\n\n\n" "</head>\n" "<body class=\"item\">\n\n" "<div id=\"puremag-outter\">\n" "<div id=\"main-header\">\n" "</div>\n" "</div>\n\n" "<nav id=\"menu\">\n" "<ul>\n" " <li><a href=\"/\">OVOSTREAMS - Home Page</a></li>\n" " </ul>\n" "</nav>\n\n" "<div id=\"content-wrap\">\n" "<div class=\"main-post\">\n" "<div class=\"main section\" id=\"Main\">\n" "<div class=\"widget Blog\" data-version=\"1\" id=\"Blog1\">\n" "<div class=\"blog-posts hfeed\">\n\n" " <div class=\"date-outer\">\n" " \n" " <div class=\"date-posts\">\n" " \n" "<div class=\"post-outer\">\n" "<div class=\"hentry uncustomized-post-template\">\n" " <div class=\"date post post-body entry-content\">\n" " Watch Games For 11/01/2020\n" " </div>\n" "<a href=\"/aston-villa-vs-man-city.php\">\n" " <div class=\" post post-body entry-content\">\n" " <div class=\"match-view-headT\">\n" " <div class=\"match-view-head-side1\">\n" " <div class=\"event-team\">\n" " <img src=\"https://www.sofascore.com/images/team-logo/football_40.png\">\n" " <h4>Aston Villa</h4>\n" " </div>\n" " </div>\n" " <div class=\"match-view-headSS\"><div>\n" " <div>\n" " <span class=\"score\">NBC Sport HD</span>\n" " </div>\n" " <div class=\"event-status\">17:30 PM</div>\n" " </div>\n" " </div>\n" " <div class=\"match-view-head-side2\">\n" " <div class=\"event-team\">\n" " <img src=\"https://www.sofascore.com/images/team-logo/football_17.png\">\n" " <h4>Manchester City</h4>\n" " </div>\n" " </div>\n" " </div>\n" "</div>\n" "</a>\n" "<a href=\"/real-madrid-vs-atl-madrid.php\">\n" " <div class=\" post post-body entry-content\">\n" " <div class=\"match-view-headT\">\n" " <div class=\"match-view-head-side1\">\n" " <div class=\"event-team\">\n" " <img src=\"https://www.sofascore.com/images/team-logo/football_2829.png\">\n" " <h4>Real Madrid</h4>\n" " </div>\n" " </div>\n" " <div class=\"match-view-headSS\"><div>\n" " <div>\n" " <span class=\"score\">Spain Super Cup</span>\n" " </div>\n" " <div class=\"event-status\">19:00 PM</div>\n" " </div>\n" " </div>\n" " <div class=\"match-view-head-side2\">\n" " <div class=\"event-team\">\n" " <img src=\"https://www.sofascore.com/images/team-logo/football_2836.png\">\n" " <h4>Atlético Madrid</h4>\n" " </div>\n" " </div>\n" " </div>\n" "</div>\n" "</a>\n" "<a href=\"/roma-vs-juventus.php\">\n" " <div class=\" post post-body entry-content\">\n" " <div class=\"match-view-headT\">\n" " <div class=\"match-view-head-side1\">\n" " <div class=\"event-team\">\n" " <img src=\"https://www.sofascore.com/images/team-logo/football_2702.png\">\n" " <h4>AS Roma</h4>\n" " </div>\n" " </div>\n" " <div class=\"match-view-headSS\"><div>\n" " <div>\n" " <span class=\"score\">Serie A</span>\n" " </div>\n" " <div class=\"event-status\">20:45 PM</div>\n" " </div>\n" " </div>\n" " <div class=\"match-view-head-side2\">\n" " <div class=\"event-team\">\n" " <img src=\"https://www.sofascore.com/images/team-logo/football_2687.png\">\n" " <h4>Juventus</h4>\n" " </div>\n" " </div>\n" " </div>\n" "</div>\n" "</div>\n" "</a>\n" "</div>\n\n" " </div></div>\n" " \n" "</div>\n\n" "<div class=\"clear\"></div>\n\n" "</div></div>\n" "</div>\n" "<div class=\"sidebar\">\n" "<div class=\"main section\" id=\"Sidebar\">\n" " <script id=\"cid0020000226121218825\" data-cfasync=\"false\" async src=\"//st.chatango.com/js/gz/emb.js\" style=\"width: 100%;height: 75%;\">{\"handle\":\"ovostreamschat\",\"arch\":\"js\",\"styles\":{\"a\":\"383838\",\"b\":30,\"c\":\"FFFFFF\",\"d\":\"FFFFFF\",\"f\":30,\"i\":30,\"k\":\"383838\",\"l\":\"383838\",\"m\":\"383838\",\"n\":\"FFFFFF\",\"o\":30,\"p\":\"10.89\",\"q\":\"383838\",\"r\":30,\"ab\":false,\"surl\":0,\"cnrs\":\"1\",\"fwtickm\":1}}</script>\n" " </div>\n" "</div>\n" "</div>\n\n" " \n" " \n" " <div id=\"menu\">\n" " \n" " <div id=\"credit-footer\">\n" "<div class=\"copyright\">\n" "<p>Created with \n" " <i aria-hidden=\"true\" class=\"fa fa-heart\" style=\"color: red;margin:0 2px;\"></i>\n" " </p>\n" "</div>\n" "</div>\n" " </div>\n" " \n" " \n" "</div>\n\n\n\n\n\n" "</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