# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"\d{1,2}\.?\d*(?= °C)"
test_str = ("<!DOCTYPE html>\n"
"<!-- Pi-hole: A black hole for Internet advertisements\n"
"* (c) 2017 Pi-hole, LLC (https://pi-hole.net)\n"
"* Network-wide ad blocking via your own hardware.\n"
"*\n"
"* This file is copyright under the latest version of the EUPL.\n"
"* Please see LICENSE file for your rights under this license. -->\n"
"<html>\n"
"<head>\n"
"<meta charset=\"UTF-8\">\n"
"<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'self' https://api.github.com; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'\">\n"
"<title>Pi-hole Admin Console</title>\n"
"<!-- Usually browsers proactively perform domain name resolution on links that the user may choose to follow. We disable DNS prefetching here -->\n"
"<meta http-equiv=\"x-dns-prefetch-control\" content=\"off\">\n"
"<!-- Tell the browser to be responsive to screen width -->\n"
"<meta content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\" name=\"viewport\">\n"
"<link rel=\"shortcut icon\" href=\"img/favicon.png\" type=\"image/x-icon\" />\n"
"<meta name=\"theme-color\" content=\"#367fa9\">\n"
"<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"img/favicon.png\">\n"
"<link rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"img/logo.svg\">\n"
"<link rel=\"icon\" type=\"image/png\" sizes=\"96x96\" href=\"img/logo.svg\">\n"
"<meta name=\"msapplication-TileColor\" content=\"#367fa9\">\n"
"<meta name=\"msapplication-TileImage\" content=\"img/logo.svg\">\n"
"<meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n\n"
"<link href=\"style/vendor/bootstrap/css/bootstrap.min.css\" rel=\"stylesheet\" type=\"text/css\" />\n"
"<link href=\"style/vendor/font-awesome-4.5.0/css/font-awesome.min.css\" rel=\"stylesheet\" type=\"text/css\" />\n"
"<link href=\"style/vendor/ionicons-2.0.1/css/ionicons.min.css\" rel=\"stylesheet\" type=\"text/css\" />\n"
"<link href=\"style/vendor/dataTables.bootstrap.min.css\" rel=\"stylesheet\" type=\"text/css\" />\n"
"<link href=\"style/vendor/daterangepicker.css\" rel=\"stylesheet\" type=\"text/css\" />\n\n"
"<link href=\"style/vendor/AdminLTE.min.css\" rel=\"stylesheet\" type=\"text/css\" />\n"
"<link href=\"style/vendor/skin-blue.min.css\" rel=\"stylesheet\" type=\"text/css\" />\n"
"<link href=\"style/pi-hole.css\" rel=\"stylesheet\" type=\"text/css\" />\n"
"<link rel=\"icon\" type=\"image/png\" sizes=\"160x160\" href=\"img/logo.svg\" />\n"
"<style type=\"text/css\">\n"
".glow { text-shadow: 0px 0px 5px #fff; }\n"
".small-box span { transition-duration: 500ms }\n"
"</style>\n\n"
"<!--[if lt IE 9]>\n"
"<script src=\"scripts/vendor/html5shiv.min.js\"></script>\n"
"<script src=\"scripts/vendor/respond.min.js\"></script>\n"
"<![endif]-->\n"
"</head>\n"
"<body class=\"skin-blue sidebar-mini layout-boxed\">\n"
"<!-- JS Warning -->\n"
"<div>\n"
"<link rel=\"stylesheet\" type=\"text/css\" href=\"style/vendor/js-warn.css\">\n"
"<input type=\"checkbox\" id=\"js-hide\" />\n"
"<div class=\"js-warn\" id=\"js-warn-exit\"><h1>Javascript Is Disabled</h1><p>Javascript seems to be disabled. This will break some site features.</p>\n"
"<p>To enable Javascript click <a href=\"http://www.enable-javascript.com/\" target=\"_blank\">here</a></p><label for=\"js-hide\">Close</label></div>\n"
"</div>\n"
"<!-- /JS Warning -->\n"
"<div id='token' hidden>YMk1aEpyY1dGrbjW80c1c0sH0ORzkoWC78MwL1YtJU4=</div><script src=\"scripts/pi-hole/js/header.js\"></script>\n"
"<!-- Send token to JS -->\n"
"<div id=\"token\" hidden>YMk1aEpyY1dGrbjW80c1c0sH0ORzkoWC78MwL1YtJU4=</div>\n"
"<div id=\"enableTimer\" hidden>1519878485000</div>\n"
"<div class=\"wrapper\">\n"
"<header class=\"main-header\">\n"
"<!-- Logo -->\n"
"<a href=\"http://pi-hole.net\" class=\"logo\" target=\"_blank\">\n"
"<!-- mini logo for sidebar mini 50x50 pixels -->\n"
"<span class=\"logo-mini\">P<b>h</b></span>\n"
"<!-- logo for regular state and mobile devices -->\n"
"<span class=\"logo-lg\">Pi-<b>hole</b></span>\n"
"</a>\n"
"<!-- Header Navbar: style can be found in header.less -->\n"
"<nav class=\"navbar navbar-static-top\" role=\"navigation\">\n"
"<!-- Sidebar toggle button-->\n"
"<a href=\"#\" class=\"sidebar-toggle\" data-toggle=\"offcanvas\" role=\"button\">\n"
"<span class=\"sr-only\">Toggle navigation</span>\n"
"</a>\n"
"<div class=\"navbar-custom-menu\">\n"
"<ul class=\"nav navbar-nav\">\n"
"<li><a style=\"pointer-events:none;\"><samp>raspberrypi</samp></a></li>\n"
"<li class=\"dropdown user user-menu\">\n"
"<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" aria-expanded=\"true\">\n"
"<img src=\"img/logo.svg\" class=\"user-image\" style=\"border-radius: initial\" sizes=\"160x160\" alt=\"Pi-hole logo\" />\n"
"<span class=\"hidden-xs\">Pi-hole</span>\n"
"</a>\n"
"<ul class=\"dropdown-menu\" style=\"right:0\">\n"
"<!-- User image -->\n"
"<li class=\"user-header\">\n"
"<img src=\"img/logo.svg\" sizes=\"160x160\" alt=\"User Image\" style=\"border-color:transparent\" />\n"
"<p>\n"
"Open Source Ad Blocker\n"
"<small>Designed For Raspberry Pi</small>\n"
"</p>\n"
"</li>\n"
"<!-- Menu Body -->\n"
"<li class=\"user-body\">\n"
"<div class=\"col-xs-4 text-center\">\n"
"<a class=\"btn-link\" href=\"https://github.com/pi-hole\" target=\"_blank\">GitHub</a>\n"
"</div>\n"
"<div class=\"col-xs-4 text-center\">\n"
"<a class=\"btn-link\" href=\"https://pi-hole.net\" target=\"_blank\">Website</a>\n"
"</div>\n"
"<div class=\"col-xs-4 text-center\">\n"
"<a class=\"btn-link\" href=\"https://github.com/pi-hole/pi-hole/releases\" target=\"_blank\">Updates</a>\n"
"</div>\n"
"<div class=\"col-xs-12 text-center\" id=\"sessiontimer\">\n"
"<b>Session is valid for <span id=\"sessiontimercounter\">0</span></b>\n"
"</div>\n"
"</li>\n"
"<!-- Menu Footer -->\n"
"<li class=\"user-footer\">\n"
"<!-- Version Infos -->\n"
"<!-- PayPal -->\n"
"<div class=\"text-center\">\n"
"<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3J2L3Z4DHW9UY\" target=\"_blank\" style=\"background:none\">\n"
"<img src=\"img/donate.gif\" alt=\"Donate\">\n"
"</a>\n"
"</div>\n"
"</li>\n"
"</ul>\n"
"</li>\n"
"</ul>\n"
"</div>\n"
"</nav>\n"
"</header>\n"
"<!-- Left side column. contains the logo and sidebar -->\n"
"<aside class=\"main-sidebar\">\n"
"<!-- sidebar: style can be found in sidebar.less -->\n"
"<section class=\"sidebar\">\n"
"<!-- Sidebar user panel -->\n"
"<div class=\"user-panel\">\n"
"<div class=\"pull-left image\">\n"
"<img src=\"img/logo.svg\" class=\"img-responsive\" alt=\"Pi-hole logo\" style=\"display: table; table-layout: fixed; height: 67px;\" />\n"
"</div>\n"
"<div class=\"pull-left info\">\n"
"<p>Status</p>\n"
"<a id=\"status\"><i class=\"fa fa-circle\" style=\"color:#7FFF00\"></i> Active</a><a id=\"temperature\"><i class=\"fa fa-fire\" style=\"color:#3366FF\"></i> Temp: 45.1 °C</a> <br/>\n"
"<a title=\"Detected 4 cores\"><i class=\"fa fa-circle\" style=\"color:#7FFF00\"></i> Load: 0.08 0.02 0.01</a> <br/>\n"
"<a><i class=\"fa fa-circle\" style=\"color:#7FFF00\"></i> Memory usage: 6.5 %</a> </div>\n"
"</div>\n"
"<!-- sidebar menu: : style can be found in sidebar.less -->\n"
"<ul class=\"sidebar-menu\">\n"
"<li class=\"header\">MAIN NAVIGATION</li>\n"
"<!-- Home Page -->\n"
"<li class=\"active\">\n"
"<a href=\"index.php\">\n"
"<i class=\"fa fa-home\"></i> <span>Dashboard</span>\n"
"</a>\n"
"</li>\n"
"<!-- Query Log -->\n"
"<li>\n"
"<a href=\"queries.php\">\n"
"<i class=\"fa fa-file-text-o\"></i> <span>Query Log</span>\n"
"</a>\n"
"</li>\n"
"<li class=\"treeview\">\n"
"<a href=\"#\">\n"
"<span class=\"pull-right-container\">\n"
"<i class=\"fa fa-angle-down pull-right\" style=\"padding-right: 5px;\"></i>\n"
"</span>\n"
"<i class=\"fa fa-clock-o\"></i> <span>Long term data</span>\n"
"</a>\n"
"<ul class=\"treeview-menu\">\n"
"<li>\n"
"<a href=\"db_graph.php\">\n"
"<i class=\"fa fa-file-text-o\"></i> <span>Graphics</span>\n"
"</a>\n"
"</li>\n"
"<li>\n"
"<a href=\"db_queries.php\">\n"
"<i class=\"fa fa-file-text-o\"></i> <span>Query Log</span>\n"
"</a>\n"
"</li>\n"
"<li>\n"
"<a href=\"db_lists.php\">\n"
"<i class=\"fa fa-file-text-o\"></i> <span>Top Lists</span>\n"
"</a>\n"
"</li>\n"
"</ul>\n"
"</li>\n"
"<!-- Whitelist -->\n"
"<li>\n"
"<a href=\"list.php?l=white\">\n"
"<i class=\"fa fa-pencil-square-o\"></i> <span>Whitelist</span>\n"
"</a>\n"
"</li>\n"
"<!-- Blacklist -->\n"
"<li>\n"
"<a href=\"list.php?l=black\">\n"
"<i class=\"fa fa-ban\"></i> <span>Blacklist</span>\n"
"</a>\n"
"</li>\n"
"<!-- Toggle -->\n\n"
"<li id=\"pihole-disable\" class=\"treeview\">\n"
"<a href=\"#\">\n"
"<span class=\"pull-right-container\">\n"
"<i class=\"fa fa-angle-down pull-right\" style=\"padding-right: 5px;\"></i>\n"
"</span>\n"
"<i class=\"fa fa-stop\"></i> <span>Disable</span> <span id=\"flip-status-disable\"></span>\n"
"</a>\n"
"<ul class=\"treeview-menu\">\n"
"<li>\n"
"<a href=\"#\" id=\"pihole-disable-permanently\">\n"
"<i class=\"fa fa-stop\"></i> <span>Permanently</span>\n"
"</a>\n"
"</li>\n"
"<li>\n"
"<a href=\"#\" id=\"pihole-disable-10s\">\n"
"<i class=\"fa fa-clock-o\"></i> <span>For 10 seconds</span>\n"
"</a>\n"
"</li>\n"
"<li>\n"
"<a href=\"#\" id=\"pihole-disable-30s\">\n"
"<i class=\"fa fa-clock-o\"></i> <span>For 30 seconds</span>\n"
"</a>\n"
"</li>\n"
"<li>\n"
"<a href=\"#\" id=\"pihole-disable-5m\">\n"
"<i class=\"fa fa-clock-o\"></i> <span>For 5 minutes</span>\n"
"</a>\n"
"</li>\n"
"<li>\n"
"<a href=\"#\" id=\"pihole-disable-cst\" data-toggle=\"modal\" data-target=\"#customDisableModal\">\n"
"<i class=\"fa fa-clock-o\"></i> <span>Custom time</span>\n"
"</a>\n"
"</li>\n"
"</ul>\n"
"<!-- <a href=\"#\" id=\"flip-status\"><i class=\"fa fa-stop\"></i> <span>Disable</span></a> -->\n"
"</li>\n"
"<li id=\"pihole-enable\" class=\"treeview\" hidden=\"true\">\n"
"<a href=\"#\"><i class=\"fa fa-play\"></i> <span id=\"enableLabel\">Enable</span> <span id=\"flip-status-enable\"></span></a>\n"
"</li>\n"
"<!-- Tools -->\n"
"<li class=\"treeview \">\n"
"<a href=\"#\">\n"
"<span class=\"pull-right-container\">\n"
"<i class=\"fa fa-angle-down pull-right\" style=\"padding-right: 5px;\"></i>\n"
"</span>\n"
"<i class=\"fa fa-folder\"></i> <span>Tools</span>\n"
"</a>\n"
"<ul class=\"treeview-menu\">\n"
"<!-- Run gravity.sh -->\n"
"<li>\n"
"<a href=\"gravity.php\">\n"
"<i class=\"fa fa-arrow-circle-down\"></i> <span>Update Lists</span>\n"
"</a>\n"
"</li>\n"
"<!-- Query adlists -->\n"
"<li>\n"
"<a href=\"queryads.php\">\n"
"<i class=\"fa fa-search\"></i> <span>Query adlists</span>\n"
"</a>\n"
"</li>\n"
"<!-- Audit log -->\n"
"<li>\n"
"<a href=\"auditlog.php\">\n"
"<i class=\"fa fa-balance-scale\"></i> <span>Audit log</span>\n"
"</a>\n"
"</li>\n"
"<!-- Tail pihole.log -->\n"
"<li>\n"
"<a href=\"taillog.php\">\n"
"<i class=\"fa fa-list-ul\"></i> <span>Tail pihole.log</span>\n"
"</a>\n"
"</li>\n"
"<!-- Tail pihole-FTL.log -->\n"
"<li>\n"
"<a href=\"taillog-FTL.php\">\n"
"<i class=\"fa fa-list-ul\"></i> <span>Tail pihole-FTL.log</span>\n"
"</a>\n"
"</li>\n"
"<!-- Generate debug log -->\n"
"<li>\n"
"<a href=\"debug.php\">\n"
"<i class=\"fa fa-ambulance\"></i> <span>Generate debug log</span>\n"
"</a>\n"
"</li>\n"
"</ul>\n"
"</li>\n"
"<!-- Settings -->\n"
"<li>\n"
"<a href=\"settings.php\">\n"
"<i class=\"fa fa-gears\"></i> <span>Settings</span>\n"
"</a>\n"
"</li>\n"
"<!-- Logout -->\n"
"<!-- Login -->\n"
"<!-- Donate -->\n"
"<li>\n"
"<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3J2L3Z4DHW9UY\" target=\"_blank\">\n"
"<i class=\"fa fa-paypal\"></i> <span>Donate</span>\n"
"</a>\n"
"</li>\n"
"<!-- Help -->\n"
"<li>\n"
"<a href=\"help.php\">\n"
"<i class=\"fa fa-question-circle\"></i> <span>Help</span>\n"
"</a>\n"
"</li>\n"
"</ul>\n"
"</section>\n"
"<!-- /.sidebar -->\n"
"</aside>\n"
"<!-- Content Wrapper. Contains page content -->\n"
"<div class=\"content-wrapper\">\n"
"<!-- Main content -->\n"
"<section class=\"content\">\n"
"<!-- Small boxes (Stat box) -->\n"
"<div class=\"row\">\n"
"<div class=\"col-lg-3 col-xs-12\">\n"
"<!-- small box -->\n"
"<div class=\"small-box bg-green\">\n"
"<div class=\"inner\">\n"
"<p>Total queries (<span id=\"unique_clients\">-</span> clients)</p>\n"
"<h3 class=\"statistic\"><span id=\"dns_queries_today\">---</span></h3>\n"
"</div>\n"
"<div class=\"icon\">\n"
"<i class=\"ion ion-earth\"></i>\n"
"</div>\n"
"</div>\n"
"</div>\n"
"<!-- ./col -->\n"
"<div class=\"col-lg-3 col-xs-12\">\n"
"<!-- small box -->\n"
"<div class=\"small-box bg-aqua\">\n"
"<div class=\"inner\">\n"
"<p>Queries Blocked</p>\n"
"<h3 class=\"statistic\"><span id=\"ads_blocked_today\">---</span></h3>\n"
"</div>\n"
"<div class=\"icon\">\n"
"<i class=\"ion ion-android-hand\"></i>\n"
"</div>\n"
"</div>\n"
"</div>\n"
"<!-- ./col -->\n"
"<div class=\"col-lg-3 col-xs-12\">\n"
"<!-- small box -->\n"
"<div class=\"small-box bg-yellow\">\n"
"<div class=\"inner\">\n"
"<p>Percent Blocked</p>\n"
"<h3 class=\"statistic\"><span id=\"ads_percentage_today\">---</span></h3>\n"
"</div>\n"
"<div class=\"icon\">\n"
"<i class=\"ion ion-pie-graph\"></i>\n"
"</div>\n"
"</div>\n"
"</div>\n"
"<!-- ./col -->\n"
"<div class=\"col-lg-3 col-xs-12\">\n"
"<!-- small box -->\n"
"<div class=\"small-box bg-red\" title=\"Blocking list updated 2 days, 20:06 ago\">\n"
"<div class=\"inner\">\n"
"<p>Domains on Blocklist</p>\n"
"<h3 class=\"statistic\"><span id=\"domains_being_blocked\">---</span></h3>\n"
"</div>\n"
"<div class=\"icon\">\n"
"<i class=\"ion ion-ios-list\"></i>\n"
"</div>\n"
"</div>\n"
"</div>\n"
"<!-- ./col -->\n"
"</div>\n\n"
"<div class=\"row\">\n"
"<div class=\"col-md-12\">\n"
"<div class=\"box\" id=\"queries-over-time\">\n"
"<div class=\"box-header with-border\">\n"
"<h3 class=\"box-title\">Queries over last 24 hours</h3>\n"
"</div>\n"
"<div class=\"box-body\">\n"
"<div class=\"chart\">\n"
"<canvas id=\"queryOverTimeChart\" width=\"800\" height=\"140\"></canvas>\n"
"</div>\n"
"</div>\n"
"<div class=\"overlay\">\n"
"<i class=\"fa fa-refresh fa-spin\"></i>\n"
"</div>\n"
"<!-- /.box-body -->\n"
"</div>\n"
"</div>\n"
"</div>\n\n"
"<div class=\"row\">\n"
"<div class=\"col-md-12\">\n"
"<div class=\"box\" id=\"clients\">\n"
"<div class=\"box-header with-border\">\n"
"<h3 class=\"box-title\">Clients (over time)</h3>\n"
"</div>\n"
"<div class=\"box-body\">\n"
"<div class=\"chart\">\n"
"<canvas id=\"clientsChart\" width=\"800\" height=\"140\"></canvas>\n"
"</div>\n"
"</div>\n"
"<div class=\"overlay\">\n"
"<i class=\"fa fa-refresh fa-spin\"></i>\n"
"</div>\n"
"<!-- /.box-body -->\n"
"</div>\n"
"</div>\n"
"</div>\n\n"
"<div class=\"row\">\n"
"<div class=\"col-md-12 col-lg-6\">\n"
"<div class=\"box\" id=\"query-types-pie\">\n"
"<div class=\"box-header with-border\">\n"
"<h3 class=\"box-title\">Query Types (integrated)</h3>\n"
"</div>\n"
"<div class=\"box-body\">\n"
"<div class=\"chart\">\n"
"<canvas id=\"queryTypePieChart\" width=\"400\" height=\"150\"></canvas>\n"
"</div>\n"
"</div>\n"
"<div class=\"overlay\">\n"
"<i class=\"fa fa-refresh fa-spin\"></i>\n"
"</div>\n"
"<!-- /.box-body -->\n"
"</div>\n"
"</div>\n"
"<div class=\"col-md-12 col-lg-6\">\n"
"<div class=\"box\" id=\"forward-destinations-pie\">\n"
"<div class=\"box-header with-border\">\n"
"<h3 class=\"box-title\">Forward Destinations (integrated)</h3>\n"
"</div>\n"
"<div class=\"box-body\">\n"
"<div class=\"chart\">\n"
"<canvas id=\"forwardDestinationPieChart\" width=\"400\" height=\"150\"></canvas>\n"
"</div>\n"
"</div>\n"
"<div class=\"overlay\">\n"
"<i class=\"fa fa-refresh fa-spin\"></i>\n"
"</div>\n"
"<!-- /.box-body -->\n"
"</div>\n"
"</div>\n"
"</div>\n\n"
"<div class=\"row\">\n"
"<div class=\"col-md-6\">\n"
"<div class=\"box\" id=\"domain-frequency\">\n"
"<div class=\"box-header with-border\">\n"
"<h3 class=\"box-title\">Top Domains</h3>\n"
"</div>\n"
"<!-- /.box-header -->\n"
"<div class=\"box-body\">\n"
"<div class=\"table-responsive\">\n"
"<table class=\"table table-bordered\">\n"
"<tbody>\n"
"<tr>\n"
"<th>Domain</th>\n"
"<th>Hits</th>\n"
"<th>Frequency</th>\n"
"</tr>\n"
"</tbody>\n"
"</table>\n"
"</div>\n"
"</div>\n"
"<div class=\"overlay\">\n"
"<i class=\"fa fa-refresh fa-spin\"></i>\n"
"</div>\n"
"<!-- /.box-body -->\n"
"</div>\n"
"<!-- /.box -->\n"
"</div>\n"
"<!-- /.col -->\n"
"<div class=\"col-md-6\">\n"
"<div class=\"box\" id=\"ad-frequency\">\n"
"<div class=\"box-header with-border\">\n"
"<h3 class=\"box-title\">Top Blocked Domains</h3>\n"
"</div>\n"
"<!-- /.box-header -->\n"
"<div class=\"box-body\">\n"
"<div class=\"table-responsive\">\n"
"<table class=\"table table-bordered\">\n"
"<tbody>\n"
"<tr>\n"
"<th>Domain</th>\n"
"<th>Hits</th>\n"
"<th>Frequency</th>\n"
"</tr>\n"
"</tbody>\n"
"</table>\n"
"</div>\n"
"</div>\n"
"<div class=\"overlay\">\n"
"<i class=\"fa fa-refresh fa-spin\"></i>\n"
"</div>\n"
"<!-- /.box-body -->\n"
"</div>\n"
"<!-- /.box -->\n"
"</div>\n"
"<!-- /.col -->\n"
"<div class=\"col-md-6\">\n"
"<div class=\"box\" id=\"client-frequency\">\n"
"<div class=\"box-header with-border\">\n"
"<h3 class=\"box-title\">Top Clients</h3>\n"
"</div>\n"
"<!-- /.box-header -->\n"
"<div class=\"box-body\">\n"
"<div class=\"table-responsive\">\n"
"<table class=\"table table-bordered\">\n"
"<tbody>\n"
"<tr>\n"
"<th>Client</th>\n"
"<th>Requests</th>\n"
"<th>Frequency</th>\n"
"</tr>\n"
"</tbody>\n"
"</table>\n"
"</div>\n"
"</div>\n"
"<div class=\"overlay\">\n"
"<i class=\"fa fa-refresh fa-spin\"></i>\n"
"</div>\n"
"<!-- /.box-body -->\n"
"</div>\n"
"<!-- /.box -->\n"
"</div>\n"
"<!-- /.col -->\n"
"</div>\n"
"<!-- /.row -->\n\n"
"</section>\n"
"<!-- /.content -->\n"
"</div>\n"
"<!-- Modal for custom disable time -->\n"
"<div class=\"modal fade\" id=\"customDisableModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\">\n"
"<div class=\"modal-dialog modal-sm\" role=\"document\">\n"
"<div class=\"modal-content\">\n"
"<div class=\"modal-header\">\n"
"<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n"
"<h4 class=\"modal-title\" id=\"myModalLabel\">Custom disable timeout</h4>\n"
"</div>\n"
"<div class=\"modal-body\">\n"
"<div class=\"input-group\">\n"
"<input id=\"customTimeout\" class=\"form-control\" type=\"number\" value=\"60\">\n"
"<div class=\"input-group-btn\" data-toggle=\"buttons\">\n"
"<label class=\"btn btn-default\">\n"
"<input type=\"radio\"/> Secs\n"
"</label>\n"
"<label id=\"btnMins\" class=\"btn btn-default active\">\n"
"<input type=\"radio\" /> Mins\n"
"</label>\n"
"</div>\n"
"</div>\n"
"</div>\n"
"<div class=\"modal-footer\">\n"
"<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n"
"<button id=\"pihole-disable-custom\" type=\"button\" class=\"btn btn-primary\" data-dismiss=\"modal\">Submit</button>\n"
"</div>\n"
"</div>\n"
"</div>\n"
"</div>\n"
"<!-- /.content-wrapper -->\n"
"<footer class=\"main-footer\">\n"
"<!-- Version Infos -->\n"
"<div class=\"pull-right hidden-xs hidden-sm\">\n"
"<b>Pi-hole Version </b> v3.3 <b>Web Interface Version </b>v3.3 <b>FTL Version </b> v3.0 </div>\n"
"<div style=\"display: inline-block\"><strong><a href=\"https://pi-hole.net/donate\" target=\"_blank\"><i class=\"fa fa-heart\"></i> Donate</a></strong> if you found this useful.</div>\n"
"</footer>\n"
"</div>\n"
"<!-- ./wrapper -->\n"
"<script src=\"scripts/vendor/jquery.min.js\"></script>\n"
"<script src=\"scripts/vendor/jquery-ui.min.js\"></script>\n"
"<script src=\"style/vendor/bootstrap/js/bootstrap.min.js\"></script>\n"
"<script src=\"scripts/vendor/app.min.js\"></script>\n\n"
"<script src=\"scripts/vendor/jquery.dataTables.min.js\"></script>\n"
"<script src=\"scripts/vendor/dataTables.bootstrap.min.js\"></script>\n"
"<script src=\"scripts/vendor/Chart.bundle.min.js\"></script>\n\n"
"<script src=\"scripts/pi-hole/js/footer.js\"></script>\n\n"
"</body>\n"
"</html>\n\n"
"<script src=\"scripts/pi-hole/js/index.js\"></script>")
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