# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(®)(?!([^\"<>]*\"(\s\s*[\w-]+=\"[^<>]*>|\s*\/?>)))"
test_str = ("<html itemscope=\"\" itemtype=\"http://schema.org/QAPage\"><head>\n\n"
"<title>php - Increase regex performance when matching only if not in html attribute - Stack Overflow</title>\n"
" <link rel=\"shortcut icon\" href=\"//cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico?v=4f32ecc8f43d\">\n"
" <link rel=\"apple-touch-icon image_src\" href=\"//cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png?v=c78bd457575a\">\n"
" <link rel=\"search\" type=\"application/opensearchdescription+xml\" title=\"Stack Overflow\" href=\"/opensearch.xml\">\n"
" <meta name=\"twitter:card\" content=\"summary\">\n"
" <meta name=\"twitter:domain\" content=\"stackoverflow.com\">\n"
" <meta property=\"og:type\" content=\"website\">\n\n"
" <meta property=\"og:image\" itemprop=\"image primaryImageOfPage\" content=\"http://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded&a\">\n"
" <meta name=\"twitter:title\" property=\"og:title\" itemprop=\"title name\" content=\"Increase regex performance when matching only if not in html attribute\">\n"
" <meta name=\"twitter:description\" property=\"og:description\" itemprop=\"description\" content=\"TYPO3 blocks rendering of pages with more than 13 content-elements when using the Typoscript:\n\n"
"brandReplacing {\n"
" stdWrap {\n"
" replacement {\n"
" 10 {\n"
" search = ®(?=[&l...\">\n"
" <meta property=\"og:url\" content=\"http://stackoverflow.com/questions/39486767/increase-regex-performance-when-matching-only-if-not-in-html-attribute\">\n"
" <link rel=\"canonical\" href=\"http://stackoverflow.com/questions/39486767/increase-regex-performance-when-matching-only-if-not-in-html-attribute\">\n\n"
" \n"
" \n"
" <script type=\"text/javascript\" async=\"\" src=\"http://engine.adzerk.net/ados?t=1473846550845&request={"Placements":[{"A":22,"S":8277,"D":"adzerk1407900611","ATA":[5,17,2221],"Z":[45]}],"Keywords":"php%2Chtml%2Cregex%2Ctypo3%2Cx-user-registered%2Cx-200plus-rep","Referrer":"http%3A%2F%2Fstackoverflow.com%2Fposts%2F39486767%2Fedit","IsAsync":true}\"></script><script async=\"\" src=\"http://edge.quantserve.com/quant.js\"></script><script async=\"\" src=\"http://b.scorecardresearch.com/beacon.js\"></script><script async=\"\" src=\"https://www.google-analytics.com/analytics.js\"></script><script type=\"text/javascript\" async=\"\" src=\"http://static.adzerk.net/ados.js\"></script><script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\"></script>\n"
" <script src=\"//cdn.sstatic.net/Js/stub.en.js?v=ac13456bebd7\"></script>\n"
" <link rel=\"stylesheet\" type=\"text/css\" href=\"//cdn.sstatic.net/Sites/stackoverflow/all.css?v=5623d8beefda\">\n\n"
" <link rel=\"alternate\" type=\"application/atom+xml\" title=\"Feed for question 'Increase regex performance when matching only if not in html attribute'\" href=\"/feeds/question/39486767\">\n"
" <meta name=\"twitter:app:country\" content=\"US\">\n"
" <meta name=\"twitter:app:name:iphone\" content=\"Stack Exchange iOS\">\n"
" <meta name=\"twitter:app:id:iphone\" content=\"871299723\">\n"
" <meta name=\"twitter:app:url:iphone\" content=\"se-zaphod://stackoverflow.com/questions/39486767/increase-regex-performance-when-matching-only-if-not-in-html-attribute\">\n"
" <meta name=\"twitter:app:name:ipad\" content=\"Stack Exchange iOS\">\n"
" <meta name=\"twitter:app:id:ipad\" content=\"871299723\">\n"
" <meta name=\"twitter:app:url:ipad\" content=\"se-zaphod://stackoverflow.com/questions/39486767/increase-regex-performance-when-matching-only-if-not-in-html-attribute\">\n"
" <meta name=\"twitter:app:name:googleplay\" content=\"Stack Exchange Android\">\n"
" <meta name=\"twitter:app:url:googleplay\" content=\"http://stackoverflow.com/questions/39486767/increase-regex-performance-when-matching-only-if-not-in-html-attribute\">\n"
" <meta name=\"twitter:app:id:googleplay\" content=\"com.stackexchange.marvin\">\n"
" <script>\n"
" \n"
" StackExchange.ready(function () {\n"
" \n"
" StackExchange.using(\"snippets\", function () {\n"
" StackExchange.snippets.initSnippetRenderer();\n"
" });\n"
" \n\n"
" StackExchange.using(\"postValidation\", function () {\n"
" StackExchange.postValidation.initOnBlurAndSubmit($('#post-form'), 2, 'answer');\n"
" });\n\n"
" \n"
" StackExchange.question.init({votesCast:[],totalCommentCount:5,shownCommentCount:5,highlightColor:'#F4A83D',backgroundColor:'#FFF',questionId:39486767});\n\n"
" styleCode();\n\n"
" StackExchange.realtime.subscribeToQuestion('1', '39486767');\n"
" StackExchange.using(\"gps\", function () { StackExchange.gps.trackOutboundClicks('#content', '.post-text'); });\n\n"
" });\n"
" </script>\n\n\n"
" <script>\n"
" StackExchange.ready(function () {\n"
" StackExchange.realtime.init('wss://qa.sockets.stackexchange.com,ws://qa.sockets.stackexchange.com');\n"
" StackExchange.realtime.subscribeToReputationNotifications('1');\n"
" StackExchange.realtime.subscribeToTopBarNotifications('1');\n"
" });\n"
" </script>\n"
" <script>\n"
" StackExchange.init({\"locale\":\"en\",\"stackAuthUrl\":\"https://stackauth.com\",\"networkMetaHostname\":\"meta.stackexchange.com\",\"serverTime\":1473846547,\"routeName\":\"Questions/Show\",\"site\":{\"name\":\"Stack Overflow\",\"description\":\"Q&A for professional and enthusiast programmers\",\"isNoticesTabEnabled\":true,\"recaptchaPublicKey\":\"6LdchgIAAAAAAJwGpIzRQSOFaO0pU6s44Xt8aTwc\",\"recaptchaAudioLang\":\"en\",\"enableNewTagCreationWarning\":true,\"insertSpaceAfterNameTabCompletion\":false,\"id\":1,\"enableInsertDocLinkDialog\":true,\"enableSocialMediaInSharePopup\":true},\"user\":{\"fkey\":\"163fdb769ceeb49041bd469392682033\",\"rep\":219,\"isRegistered\":true,\"userType\":3,\"userId\":5422107,\"accountId\":7085060,\"gravatar\":\"<div class=\\\"gravatar-wrapper-32\\\"><img src=\\\"https://i.stack.imgur.com/DobWy.png?s=32&g=1\\\" alt=\\\"\\\" width=\\\"32\\\" height=\\\"32\\\"></div>\",\"profileUrl\":\"http://stackoverflow.com/users/5422107/y-hermes\",\"canSeeDeletedPosts\":false},\"realtime\":{\"newest\":false,\"active\":false,\"tagged\":true,\"workerIframeDomain\":\"http://cdn.sstatic.net\"}}, {\"site\":{\"allowImageUploads\":true,\"enableUserHovercards\":true,\"styleCode\":true,\"enableNewLinkInsertDialog\":true},\"tags\":{},\"accounts\":{\"currentPasswordRequiredForChangingStackIdPassword\":true},\"flags\":{\"allowRetractingFlags\":true},\"snippets\":{\"snippetsEnabled\":true,\"renderDomain\":\"stacksnippets.net\"},\"markdown\":{\"asteriskIntraWordEmphasis\":true}});\n"
" StackExchange.using.setCacheBreakers({\"js/prettify-full.en.js\":\"0696d93dfb99\",\"js/moderator.en.js\":\"d53fcdd08c4f\",\"js/full-anon.en.js\":\"04ad440fa4dc\",\"js/full.en.js\":\"cee04076d19a\",\"js/wmd.en.js\":\"65dfb5f8de64\",\"js/third-party/jquery.autocomplete.min.js\":\"e5f01e97f7c3\",\"js/third-party/jquery.autocomplete.min.en.js\":\"\",\"js/mobile.en.js\":\"89c3667c46bc\",\"js/help.en.js\":\"dbd4f489eff2\",\"js/tageditor.en.js\":\"4af7bd263513\",\"js/tageditornew.en.js\":\"96cd569991ad\",\"js/inline-tag-editing.en.js\":\"a815357d00cd\",\"js/revisions.en.js\":\"cf90cfea0ccf\",\"js/review.en.js\":\"18568da9a695\",\"js/tagsuggestions.en.js\":\"78eee7c19ab2\",\"js/post-validation.en.js\":\"991865b0743e\",\"js/explore-qlist.en.js\":\"e71f14781288\",\"js/events.en.js\":\"76fdd1d3b88a\",\"js/keyboard-shortcuts.en.js\":\"4565f1531be4\",\"js/external-editor.en.js\":\"93769406446f\",\"js/external-editor.en.js\":\"93769406446f\",\"js/snippet-javascript.en.js\":\"cc5508c2e17e\",\"js/snippet-javascript-codemirror.en.js\":\"6d0763e65794\"});\n"
" StackExchange.using(\"gps\", function() {\n"
" StackExchange.gps.init(true);\n"
" });\n"
" </script>\n"
" \n"
"<script async=\"\" src=\"//cdn.sstatic.net/Js/full.en.js?v=cee04076d19a\"></script><script async=\"\" src=\"//cdn.sstatic.net/Js/snippet-javascript.en.js?v=cc5508c2e17e\"></script><script async=\"\" src=\"//cdn.sstatic.net/Js/post-validation.en.js?v=991865b0743e\"></script><script async=\"\" src=\"//cdn.sstatic.net/Js/prettify-full.en.js?v=0696d93dfb99\"></script><script async=\"\" src=\"//cdn.sstatic.net/Js/external-editor.en.js?v=93769406446f\"></script><script async=\"\" src=\"//cdn.sstatic.net/Js/wmd.en.js?v=65dfb5f8de64\"></script><script type=\"text/javascript\" src=\"http://static.adzerk.net/Extensions/adFeedback.js\"></script><link rel=\"stylesheet\" href=\"http://static.adzerk.net/Extensions/adFeedback.css\"><link type=\"text/css\" rel=\"stylesheet\" href=\"//cdn.sstatic.net/clc/styles/clc/jobs-multi.min.css?v=bf2a9ba1db72\"></head>\n"
"<body class=\"question-page new-topbar\">\n"
" <noscript><div id=\"noscript-padding\"></div></noscript>\n"
" \n\n\n\n"
" <div id=\"notify-container\"></div>\n"
" <div id=\"custom-header\"></div>\n\n\n\n\n\n"
"<div class=\"topbar\">\n"
" <div class=\"topbar-wrapper\">\n\n"
" <div class=\"js-topbar-dialog-corral\">\n\n\n"
"<div class=\"topbar-dialog siteSwitcher-dialog dno\">\n"
" <div class=\"header\">\n"
" <h3><a href=\"//stackoverflow.com\">current community</a></h3>\n"
" </div>\n"
" <div class=\"modal-content current-site-container\">\n"
" <ul class=\"current-site\">\n"
" <li>\n"
" <div class=\"related-links\">\n"
" <a href=\"http://chat.stackoverflow.com\" class=\"js-gps-track\" data-gps-track=\"site_switcher.click({ item_type:6 })\">chat</a>\n"
" <a href=\"/users/logout\" class=\"js-gps-track\" data-gps-track=\"site_switcher.click({ item_type:8 })\">log out</a>\n"
" </div>\n\n\n\n\n"
" <a href=\"//stackoverflow.com\" class=\"current-site-link site-link js-gps-track\" data-id=\"1\" data-gps-track=\"\n"
" site_switcher.click({ item_type:3 })\">\n"
" <div class=\"site-icon favicon favicon-stackoverflow\" title=\"Stack Overflow\"></div>\n"
" Stack Overflow\n"
" </a>\n\n"
" </li>\n"
" <li class=\"related-site\">\n"
" <div class=\"L-shaped-icon-container\">\n"
" <span class=\"L-shaped-icon\"></span>\n"
" </div>\n\n"
" \n\n\n\n"
" <a href=\"http://meta.stackoverflow.com\" class=\"site-link js-gps-track\" data-id=\"552\" data-gps-track=\"\n"
" site.switch({ target_site:552, item_type:3 }),\n"
" site_switcher.click({ item_type:4 })\">\n"
" <div class=\"site-icon favicon favicon-stackoverflowmeta\" title=\"Meta Stack Overflow\"></div>\n"
" Meta Stack Overflow\n"
" </a>\n\n"
" </li>\n"
" </ul>\n"
" </div>\n"
" <div class=\"header\" id=\"your-communities-header\">\n"
" <h3>\n"
" <a href=\"//stackexchange.com/users/7085060/?tab=accounts\">your communities</a>\n"
" </h3>\n"
" \n"
" <a href=\"#\" id=\"edit-pinned-sites\">edit</a>\n"
" <a href=\"#\" id=\"cancel-pinned-sites\" style=\"display: none;\">cancel</a>\n"
" </div>\n"
" <div class=\"modal-content\" id=\"your-communities-section\">\n"
" \n"
" <ul class=\"my-sites\">\n"
" <li>\n"
" \n\n\n\n"
" <a href=\"//stackoverflow.com\" class=\"site-link js-gps-track\" data-id=\"1\" data-gps-track=\"\n"
" site.switch({ target_site:1, item_type:3 }),\n"
" site_switcher.click({ item_type:1 })\">\n"
" <div class=\"site-icon favicon favicon-stackoverflow\" title=\"Stack Overflow\"></div>\n"
" Stack Overflow\n"
" <span class=\"rep-score\">219</span>\n"
" </a>\n\n"
" </li>\n"
" </ul>\n"
" <div class=\"pinned-site-editor-container\" style=\"display: none;\">\n"
" <input id=\"js-site-search-txt\" type=\"text\" class=\"site-filter-input\" value=\"\" placeholder=\"Add a Stack Exchange community\">\n"
" <input type=\"submit\" id=\"pin-site-btn\" value=\"Add\" disabled=\"disabled\">\n"
" <ul class=\"js-found-sites found-sites\"></ul>\n"
" <ul class=\"pinned-site-list sortable\" data-custom-list=\"False\">\n"
" </ul>\n"
" <input type=\"submit\" value=\"Save\" id=\"save-pinned-sites-btn\" disabled=\"disabled\">\n"
" <a href=\"#\" id=\"reset-pinned-sites\">reset to default list</a>\n"
" </div>\n"
" </div>\n"
" <div class=\"header\">\n"
" <h3><a href=\"//stackexchange.com/sites\">more stack exchange communities</a></h3>\n"
" <a href=\"http://blog.stackoverflow.com\" class=\"fr\">company blog</a>\n"
" </div>\n"
" <div class=\"modal-content\">\n"
" <div class=\"child-content\"></div>\n"
" </div>\n"
"</div>\n"
" </div>\n\n"
" <div class=\"network-items\">\n"
" <a href=\"//stackexchange.com\" class=\"topbar-icon icon-site-switcher yes-hover js-site-switcher-button js-gps-track\" data-gps-track=\"site_switcher.show\" title=\"A list of all 161 Stack Exchange sites\">\n"
" <span class=\"hidden-text\">Stack Exchange</span>\n"
" </a>\n\n"
" <a href=\"#\" class=\"topbar-icon icon-inbox yes-hover js-inbox-button\" title=\"You have unread inbox messages\">\n"
" <span class=\"hidden-text\">Inbox</span>\n"
" <span class=\"unread-count\" style=\"display: inline-block;\">2</span>\n"
" </a>\n"
" <a href=\"#\" class=\"topbar-icon icon-achievements yes-hover js-achievements-button\" data-unread-class=\"\" title=\"Recent achievements: reputation, badges, and privileges earned\">\n"
" <span class=\"hidden-text\">Reputation and Badges</span>\n"
" <span class=\"unread-count\" style=\"display:none\">\n"
" \n"
" </span>\n"
" </a>\n"
" </div>\n\n"
" <div class=\"topbar-links\">\n\n"
" <a href=\"/users/5422107/y-hermes\" class=\"profile-me js-gps-track\" data-gps-track=\"profile_summary.click()\">\n"
" \n"
" <div class=\"gravatar-wrapper-24\" title=\"Y.Hermes\"><img src=\"https://i.stack.imgur.com/DobWy.png?s=48&g=1\" alt=\"\" width=\"24\" height=\"24\" class=\"avatar-me js-avatar-me\"></div>\n\n"
" <div class=\"links-container topbar-flair\">\n\n"
" <span class=\"reputation\" title=\"your reputation: 219\">\n"
" 219\n"
" </span>\n"
"<span title=\"1 silver badge\"><span class=\"badge2\"></span><span class=\"badgecount\">1</span></span><span title=\"17 bronze badges\"><span class=\"badge3\"></span><span class=\"badgecount\">17</span></span> </div>\n"
" </a>\n"
" <div class=\"links-container\">\n"
" <span class=\"topbar-menu-links\">\n\n\n\n"
" <a href=\"/review\" title=\"Review queues - help improve the site\">\n"
" review\n"
" </a>\n\n"
" <a href=\"#\" class=\"icon-help js-help-button\" title=\"Help Center and other resources\">\n"
" help\n"
" <span class=\"triangle\"></span>\n"
" </a>\n"
" <div class=\"topbar-dialog help-dialog js-help-dialog dno\">\n"
" <div class=\"modal-content\">\n"
" <ul>\n"
" <li>\n"
" <a href=\"/tour\" class=\"js-gps-track\" data-gps-track=\"help_popup.click({ item_type:1 })\">\n"
" Tour\n"
" <span class=\"item-summary\">\n"
" Start here for a quick overview of the site\n"
" </span>\n"
" </a>\n"
" </li>\n"
" <li>\n"
" <a href=\"/help\" class=\"js-gps-track\" data-gps-track=\"help_popup.click({ item_type:4 })\">\n"
" Help Center\n"
" <span class=\"item-summary\">\n"
" Detailed answers to any questions you might have\n"
" </span>\n"
" </a>\n"
" </li>\n"
" <li>\n"
" <a href=\"//meta.stackoverflow.com\" class=\"js-gps-track\" data-gps-track=\"help_popup.click({ item_type:2 })\">\n"
" Meta\n"
" <span class=\"item-summary\">\n"
" Discuss the workings and policies of this site\n"
" </span>\n"
" </a>\n"
" </li>\n"
" <li>\n"
" <a href=\"http://stackoverflow.com/company/about\" class=\"js-gps-track\" data-gps-track=\"help_popup.click({ item_type:6 })\">\n"
" About Us\n"
" <span class=\"item-summary\">\n"
" Learn more about Stack Overflow the company\n"
" </span>\n"
" </a>\n"
" </li>\n"
" <li>\n"
" <a href=\"http://business.stackoverflow.com/?ref=topbar_help\" class=\"js-gps-track\" data-gps-track=\"help_popup.click({ item_type:7 })\">\n"
" Business\n"
" <span class=\"item-summary\">\n"
" Learn more about hiring developers or posting ads with us\n"
" </span>\n"
" </a>\n"
" </li>\n"
" </ul>\n"
" </div>\n"
" </div>\n"
" </span>\n"
" </div>\n\n"
" <div class=\"search-container\">\n"
" <form id=\"search\" action=\"/search\" method=\"get\" autocomplete=\"off\">\n"
" <input name=\"q\" type=\"text\" placeholder=\"Search Q&A\" value=\"\" tabindex=\"1\" autocomplete=\"off\" maxlength=\"240\">\n"
" </form>\n"
" </div>\n\n"
" </div>\n"
" </div>\n"
"</div>\n"
" <script>\n"
" StackExchange.ready(function() { StackExchange.topbar.init(); });\n"
" </script>\n\n"
" <div class=\"container\">\n"
" <div id=\"header\">\n"
" <br class=\"cbt\">\n"
" <div id=\"hlogo\">\n"
" <a href=\"/\">\n"
" Stack Overflow\n"
" </a>\n"
" </div>\n"
" <div id=\"hmenus\">\n"
" <div class=\"nav mainnavs\">\n"
" <ul>\n"
" <li class=\"youarehere\"><a id=\"nav-questions\" href=\"/questions\">Questions</a></li>\n"
" <li><a id=\"nav-jobs\" href=\"/jobs?med=site-ui&ref=jobs-tab\">Jobs</a></li>\n"
" <li><a id=\"nav-docs\" href=\"/documentation\">Documentation</a></li>\n"
" <li><a id=\"nav-tags\" href=\"/tags\">Tags</a></li>\n"
" <li><a id=\"nav-users\" href=\"/users\">Users</a></li>\n"
" <li><a id=\"nav-badges\" href=\"/help/badges\">Badges</a></li>\n"
" </ul>\n"
" </div>\n"
" <div class=\"nav askquestion\">\n"
" <ul>\n"
" <li>\n"
" <a id=\"nav-askquestion\" href=\"/questions/ask\">Ask Question</a>\n"
" </li>\n"
" </ul>\n"
" </div>\n"
" </div>\n"
" </div>\n"
" \n\n\n\n"
" <div id=\"content\" class=\"snippet-hidden\">\n"
" \n\n"
"<div itemscope=\"\" itemtype=\"http://schema.org/Question\">\n"
" <link itemprop=\"image\" href=\"//cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png?v=c78bd457575a\">\n"
"<div class=\"hero-box docs-announcement\">\n"
" <div class=\"hero-close js-dismiss\">Dismiss</div>\n"
" \n"
" \n"
" <div class=\"hero-content text-left\">\n"
" <div class=\"text-wrapper\">\n"
" <div class=\"hero-title\">\n"
" Announcing Stack Overflow Documentation\n"
" </div>\n\n"
" <p class=\"subtitle\">\n"
" We started with Q&A. Technical documentation is next, and we need your help.\n"
" </p>\n"
" <p class=\"subtitle\">\n"
" Whether you're a beginner or an experienced developer, you <i>can</i> contribute.\n"
" </p>\n"
" </div>\n\n"
" <a href=\"/tour/documentation\" class=\"btn js-gps-track\" data-gps-track=\"docs.hero.clicked({target: 1 })\">\n"
" I want to help →\n"
" </a>\n\n"
" <div class=\"img\"></div>\n"
" </div>\n"
"</div>\n\n"
"<script>\n"
" StackExchange.ready(function() {\n"
" var location = 0;\n"
" if ($(\"body\").hasClass(\"question-page\")) {\n"
" location = 2;\n"
" } else if ($(\"body\").hasClass(\"home-page\")) {\n"
" location = 1;\n"
" }\n\n"
" $(\".docs-announcement .js-dismiss\").one(\"click\", function() {\n"
" $(\".docs-announcement\").fadeOut(\"fast\");\n"
" $.post(\"/dismiss-documentation-hero\", { fkey: StackExchange.options.user.fkey, location: location });\n"
" });\n\n"
" StackExchange.using(\"gps\", function () {\n"
" StackExchange.gps.track(\"docs.hero.show\", { location: location }, true);\n"
" });\n"
" });\n"
"</script> <div id=\"question-header\">\n"
" <h1 itemprop=\"name\"><a href=\"/questions/39486767/increase-regex-performance-when-matching-only-if-not-in-html-attribute\" class=\"question-hyperlink\">Increase regex performance when matching only if not in html attribute</a></h1>\n"
" </div>\n"
" <div id=\"mainbar\">\n\n"
" \n\n"
"<div class=\"question\" data-questionid=\"39486767\" id=\"question\">\n\n"
" <input type=\"hidden\" id=\"39486767-only-allow-inform-moderator-flagging\" value=\"true\">\n"
" <table>\n"
" <tbody><tr>\n"
" <td class=\"votecell\">\n"
" \n\n"
"<div class=\"vote\">\n"
" <input type=\"hidden\" name=\"_id_\" value=\"39486767\">\n"
" <a class=\"vote-up-off\" title=\"This question shows research effort; it is useful and clear\">up vote</a>\n"
" <span itemprop=\"upvoteCount\" class=\"vote-count-post \">0</span>\n"
" <a class=\"vote-down-off\" title=\"This question does not show any research effort; it is unclear or not useful\">down vote</a>\n\n"
" <a class=\"star-off\" href=\"#\" title=\"Click to mark as favorite question (click again to undo)\">favorite</a>\n"
" <div class=\"favoritecount\"><b></b></div>\n\n\n"
"</div>\n\n"
" </td>\n"
" \n"
"<td class=\"postcell\">\n"
"<div>\n"
" <div class=\"post-text\" itemprop=\"text\">\n\n"
"<p>TYPO3 blocks rendering of pages with more than 13 content-elements when using the Typoscript:</p>\n\n"
"<pre class=\"lang-php prettyprint prettyprinted\"><code><span class=\"pln\">brandReplacing </span><span class=\"pun\">{</span><span class=\"pln\">\n"
" stdWrap </span><span class=\"pun\">{</span><span class=\"pln\">\n"
" replacement </span><span class=\"pun\">{</span><span class=\"pln\">\n"
" </span><span class=\"lit\">10</span><span class=\"pln\"> </span><span class=\"pun\">{</span><span class=\"pln\">\n"
" search </span><span class=\"pun\">=</span><span class=\"pln\"> </span><span class=\"pun\">®(?=[<]*(?:<[^>]*>[^<]*)*</span><span class=\"pln\">$</span><span class=\"pun\">)</span><span class=\"pln\">\n"
" replace </span><span class=\"pun\">=</span><span class=\"pln\"> </span><span class=\"str\"><sup></span><span class=\"pun\">®</</span><span class=\"pln\">sup</span><span class=\"pun\">></span><span class=\"pln\">\n"
" useRegExp </span><span class=\"pun\">=</span><span class=\"pln\"> </span><span class=\"lit\">1</span><span class=\"pln\">\n"
" </span><span class=\"pun\">}</span><span class=\"pln\">\n"
" </span><span class=\"pun\">}</span><span class=\"pln\">\n"
" </span><span class=\"pun\">}</span><span class=\"pln\">\n"
"</span><span class=\"pun\">}</span></code></pre>\n\n"
"<p>as the regex even needs 118 Steps for this short <a href=\"https://regex101.com/r/mA1rL1/1\" rel=\"nofollow\">example</a> (steps needed increases exponentially / like 83000 steps needed for two more attributes). All in all the regex works fine but is too \"huge\".</p>\n\n"
"<p>Does anybody have an idea how to reduce the steps (performance) needed to execute the regex and maybe also exclude <code>®</code>-Symbols already wrapped with <code><sup></code>-tags? Or is there a better way to solve this problem TYPO3-sided?</p>\n\n"
"<p>The regex like above:</p>\n\n"
"<pre class=\"lang-php prettyprint prettyprinted\"><code><span class=\"pun\">®(?=[<]*(?:<[^>]*>[^<]*)*</span><span class=\"pln\">$</span><span class=\"pun\">)</span></code></pre>\n\n"
"<p>The html code:</p>\n\n"
"<pre class=\"lang-php prettyprint prettyprinted\"><code><span class=\"tag\"><img</span><span class=\"pln\"> </span><span class=\"atn\">title</span><span class=\"pun\">=</span><span class=\"atv\">\"Copyright replacement incorrect ®\"</span><span class=\"pln\"> </span><span class=\"atn\">src</span><span class=\"pun\">=</span><span class=\"atv\">\"/fileadmin/filexyz.png\"</span><span class=\"tag\">></span><span class=\"pln\">\n"
"</span><span class=\"tag\"><h1></span><span class=\"pln\">Copyright replacement correct: ®</span><span class=\"tag\"></h1></span><span class=\"pln\">\n"
"Also correct replacement here: ®\n"
"Maybe NOT here: </span><span class=\"tag\"><sup></span><span class=\"pln\">®</span><span class=\"tag\"></sup></span></code></pre>\n"
" </div>\n"
" <div class=\"post-taglist\">\n"
" <a href=\"/questions/tagged/php\" class=\"post-tag js-gps-track\" title=\"show questions tagged 'php'\" rel=\"tag\">php</a> <a href=\"/questions/tagged/html\" class=\"post-tag js-gps-track\" title=\"show questions tagged 'html'\" rel=\"tag\">html</a> <a href=\"/questions/tagged/regex\" class=\"post-tag js-gps-track\" title=\"show questions tagged 'regex'\" rel=\"tag\">regex</a> <a href=\"/questions/tagged/typo3\" class=\"post-tag js-gps-track\" title=\"show questions tagged 'typo3'\" rel=\"tag\">typo3</a> \n"
" </div>\n"
" <table class=\"fw\">\n"
" <tbody><tr>\n"
" <td class=\"vt\">\n"
"<div class=\"post-menu\"><a href=\"/q/39486767/5422107\" title=\"short permalink to this question\" class=\"short-link\" id=\"link-post-39486767\">share</a><span class=\"lsep\">|</span><a href=\"/posts/39486767/edit\" class=\"edit-post\" title=\"revise and improve this post\">edit</a><span class=\"lsep\">|</span><a href=\"#\" id=\"delete-post-39486767\" title=\"vote to delete this post\" class=\"\" data-delete-prompt=\"Delete this post?\" data-undelete-prompt=\"Undelete this post?\">delete</a><span class=\"lsep\">|</span><a href=\"#\" class=\"flag-post-link\" title=\"flag this post for serious problems or moderator attention\" data-postid=\"39486767\">flag</a></div> \n"
" </td>\n"
" <td align=\"right\" class=\"post-signature\">\n"
"<div class=\"user-info \">\n"
" <div class=\"user-action-time\">\n"
" <a href=\"/posts/39486767/revisions\" title=\"show all edits to this post\">edited <span title=\"2016-09-14 09:38:53Z\" class=\"relativetime\">12 mins ago</span></a>\n"
" </div>\n"
" <div class=\"user-gravatar32\">\n"
" \n"
" </div>\n"
" <div class=\"user-details\">\n"
" \n"
" <div class=\"-flair\">\n"
" \n"
" </div>\n"
" </div>\n"
"</div> </td>\n"
" <td class=\"post-signature owner\">\n"
" <div class=\"user-info \">\n"
" <div class=\"user-action-time\">\n"
" asked <span title=\"2016-09-14 09:19:04Z\" class=\"relativetime\">32 mins ago</span>\n"
" </div>\n"
" <div class=\"user-gravatar32\">\n"
" <a href=\"/users/5422107/y-hermes\"><div class=\"gravatar-wrapper-32\"><img src=\"https://i.stack.imgur.com/DobWy.png?s=32&g=1\" alt=\"\" width=\"32\" height=\"32\"></div></a>\n"
" </div>\n"
" <div class=\"user-details\">\n"
" <a href=\"/users/5422107/y-hermes\">Y.Hermes</a>\n"
" <div class=\"-flair\">\n"
" <span class=\"reputation-score\" title=\"reputation score \" dir=\"ltr\">219</span><span title=\"1 silver badge\"><span class=\"badge2\"></span><span class=\"badgecount\">1</span></span><span title=\"17 bronze badges\"><span class=\"badge3\"></span><span class=\"badgecount\">17</span></span>\n"
" </div>\n"
" </div>\n"
"</div>\n"
" </td>\n"
" </tr>\n"
" </tbody></table>\n"
"</div>\n"
"</td>\n"
" </tr>\n"
" \n"
"<tr>\n"
" <td class=\"votecell\"></td>\n"
" <td>\n"
" <div id=\"comments-39486767\" class=\"comments\">\n"
" <table>\n"
" <tbody data-remaining-comments-count=\"0\" data-canpost=\"true\" data-cansee=\"false\" data-comments-unavailable=\"false\" data-addlink-disabled=\"false\">\n\n"
" <tr id=\"comment-66291719\" class=\"comment \">\n"
" <td class=\"comment-actions\">\n"
" <table>\n"
" <tbody>\n"
" <tr>\n"
" <td class=\" comment-score\">\n"
" <span title=\"number of 'useful comment' votes received\" class=\"cool\">1</span>\n"
" </td>\n"
" <td>\n"
" <div class=\"comment-up-on\" title=\"you've voted for this as a useful comment\">up voted</div>\n"
" </td>\n"
" </tr>\n"
" <tr>\n"
" <td> </td>\n"
" <td>\n"
" <a class=\"comment-flag\" title=\"Flag this comment for serious problems or moderator attention\">flag</a>\n"
" </td>\n"
" </tr>\n"
" </tbody>\n"
" </table>\n"
" </td>\n"
" <td class=\"comment-text\">\n"
" <div style=\"display: block;\" class=\"comment-body\">\n"
" <span class=\"comment-copy\">Try with a possessive quantifier: <code>®(?=[^<>]*+(?:<[^>]*>[^<]*)*$)</code></span>\n"
" – <a href=\"/users/3832970/wiktor-stribi%c5%bcew\" title=\"126,061 reputation\" class=\"comment-user\">Wiktor Stribiżew</a>\n"
" <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"#comment66291719_39486767\"><span title=\"2016-09-14 09:22:11Z\" class=\"relativetime-clean\">28 mins ago</span></a></span>\n"
" </div>\n"
" </td>\n"
" </tr>\n"
" <tr id=\"comment-66291904\" class=\"comment \">\n"
" <td>\n"
" <table>\n"
" <tbody>\n"
" <tr>\n"
" <td class=\" comment-score\">\n"
" \n"
" </td>\n"
" <td>\n"
" \n"
" </td>\n"
" </tr>\n"
" </tbody>\n"
" </table>\n"
" </td>\n"
" <td class=\"comment-text\">\n"
" <div style=\"display: block;\" class=\"comment-body\">\n"
" <span class=\"comment-copy\">Wow! Awesome, this was like 75% performance increasing. Do you also have an idea how to exclude already wrapped <code>®</code>-Symbols? Otherwise i will accept that answer ;)</span>\n"
" – <a href=\"/users/5422107/y-hermes\" title=\"219 reputation\" class=\"comment-user owner\">Y.Hermes</a>\n"
" <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"#comment66291904_39486767\"><span title=\"2016-09-14 09:27:06Z\" class=\"relativetime-clean\">24 mins ago</span></a></span>\n"
" \n"
" <a class=\"comment-delete delete-tag\" title=\"delete this comment\">\n"
" </a>\n"
" <a class=\"comment-delete-empty\" href=\"#\" title=\"delete this comment\"></a> </div>\n"
" </td>\n"
" </tr>\n"
" <tr id=\"comment-66292515\" class=\"comment \">\n"
" <td class=\"comment-actions\">\n"
" <table>\n"
" <tbody>\n"
" <tr>\n"
" <td class=\" comment-score\">\n"
" \n"
" </td>\n"
" <td>\n"
" <a class=\"comment-up comment-up-off\" title=\"this comment adds something useful to the post\">upvote</a>\n"
" </td>\n"
" </tr>\n"
" <tr>\n"
" <td> </td>\n"
" <td>\n"
" <a class=\"comment-flag\" title=\"Flag this comment for serious problems or moderator attention\">flag</a>\n"
" </td>\n"
" </tr>\n"
" </tbody>\n"
" </table>\n"
" </td>\n"
" <td class=\"comment-text\">\n"
" <div style=\"display: block;\" class=\"comment-body\">\n"
" <span class=\"comment-copy\"><a href=\"http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454\" title=\"regex match open tags except xhtml self contained tags\">stackoverflow.com/questions/1732348/…</a></span>\n"
" – <a href=\"/users/752701/jost\" title=\"4,203 reputation\" class=\"comment-user\">Jost</a>\n"
" <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"#comment66292515_39486767\"><span title=\"2016-09-14 09:43:54Z\" class=\"relativetime-clean\">7 mins ago</span></a></span>\n"
" </div>\n"
" </td>\n"
" </tr>\n"
" <tr id=\"comment-66292597\" class=\"comment \">\n"
" <td>\n"
" <table>\n"
" <tbody>\n"
" <tr>\n"
" <td class=\" comment-score\">\n"
" \n"
" </td>\n"
" <td>\n"
" \n"
" </td>\n"
" </tr>\n"
" </tbody>\n"
" </table>\n"
" </td>\n"
" <td class=\"comment-text\">\n"
" <div style=\"display: block;\" class=\"comment-body\">\n"
" <span class=\"comment-copy\">As far as I tested that with \"real\" data, the steps just reduced from 275809 to 273256...</span>\n"
" – <a href=\"/users/5422107/y-hermes\" title=\"219 reputation\" class=\"comment-user owner\">Y.Hermes</a>\n"
" <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"#comment66292597_39486767\"><span title=\"2016-09-14 09:45:57Z\" class=\"relativetime-clean\">5 mins ago</span></a></span>\n"
" \n"
" <a class=\"comment-delete delete-tag\" title=\"delete this comment\">\n"
" </a>\n"
" <a class=\"comment-delete-empty\" href=\"#\" title=\"delete this comment\"></a> </div>\n"
" </td>\n"
" </tr>\n"
" <tr id=\"comment-66292711\" class=\"comment \">\n"
" <td class=\"comment-actions\">\n"
" <table>\n"
" <tbody>\n"
" <tr>\n"
" <td class=\" comment-score\">\n"
" \n"
" </td>\n"
" <td>\n"
" \n"
" </td>\n"
" </tr>\n"
" </tbody>\n"
" </table>\n"
" </td>\n"
" <td class=\"comment-text\">\n"
" <div style=\"display: block;\" class=\"comment-body\">\n"
" <span class=\"comment-copy\">@Jost, I am not parsing the html, this is a TYPO3 function that (i think) just parses each content element's content.</span>\n"
" – <a href=\"/users/5422107/y-hermes\" title=\"219 reputation\" class=\"comment-user owner\">Y.Hermes</a>\n"
" <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"#comment66292711_39486767\"><span title=\"2016-09-14 09:49:05Z\" class=\"relativetime-clean\">2 mins ago</span></a></span>\n"
" \n"
" <a class=\"comment-edit\">edit</a>\n"
" \n"
" <a class=\"comment-delete delete-tag\" title=\"delete this comment\">\n"
" </a>\n"
" <a class=\"comment-delete-empty\" href=\"#\" title=\"delete this comment\"></a> </div>\n"
" <form id=\"edit-comment-39486767\" class=\"dno\"><div class=\"dno\">@Jost, I am not parsing the html, this is a TYPO3 function that (i think) just parses each content element's content.</div></form>\n"
" </td>\n"
" </tr>\n"
" <tr id=\"comment-66292723\" class=\"comment \">\n"
" <td class=\"comment-actions\">\n"
" <table>\n"
" <tbody>\n"
" <tr>\n"
" <td class=\" comment-score\">\n"
" \n"
" </td>\n"
" <td>\n"
" <a class=\"comment-up comment-up-off\" title=\"this comment adds something useful to the post\">upvote</a>\n"
" </td>\n"
" </tr>\n"
" <tr>\n"
" <td> </td>\n"
" <td>\n"
" <a class=\"comment-flag\" title=\"Flag this comment for serious problems or moderator attention\">flag</a>\n"
" </td>\n"
" </tr>\n"
" </tbody>\n"
" </table>\n"
" </td>\n"
" <td class=\"comment-text\">\n"
" <div style=\"display: block;\" class=\"comment-body\">\n"
" <span class=\"comment-copy\">Provide us a demo with actual input.</span>\n"
" – <a href=\"/users/1020526/revo\" title=\"10,131 reputation\" class=\"comment-user\">revo</a>\n"
" <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"#comment66292723_39486767\"><span title=\"2016-09-14 09:49:30Z\" class=\"relativetime-clean\">1 min ago</span></a></span>\n"
" </div>\n"
" </td>\n"
" </tr>\n"
" <tr id=\"comment-66292766\" class=\"comment \">\n"
" <td class=\"comment-actions\">\n"
" <table>\n"
" <tbody>\n"
" <tr>\n"
" <td class=\" comment-score\">\n"
" \n"
" </td>\n"
" <td>\n"
" \n"
" </td>\n"
" </tr>\n"
" </tbody>\n"
" </table>\n"
" </td>\n"
" <td class=\"comment-text\">\n"
" <div style=\"display: block;\" class=\"comment-body\">\n"
" <span class=\"comment-copy\">I would like to but can't because of privacy reasons... But i'm trying to find something similar.</span>\n"
" – <a href=\"/users/5422107/y-hermes\" title=\"219 reputation\" class=\"comment-user owner\">Y.Hermes</a>\n"
" <span class=\"comment-date\" dir=\"ltr\"><a class=\"comment-link\" href=\"#comment66292766_39486767\"><span title=\"2016-09-14 09:50:31Z\" class=\"relativetime-clean\">37 secs ago</span></a></span>\n"
" <span class=\"edited-yes\" title=\"this comment was edited 1 time\"></span>\n"
" \n"
" <a class=\"comment-edit\">edit</a>\n"
" \n"
" <a class=\"comment-delete delete-tag\" title=\"delete this comment\">\n"
" </a>\n"
" <a class=\"comment-delete-empty\" href=\"#\" title=\"delete this comment\"></a> </div>\n"
" <form id=\"edit-comment-39486767\" class=\"dno\"><div class=\"dno\">I would like to but can't because of privacy reasons... But i'm trying to find something similar.</div></form>\n"
" </td>\n"
" </tr>\n"
"</tbody>\n"
" <tfoot>\n"
" <tr>\n"
" <td></td>\n"
" <td class=\"comment-form\">\n"
" <form id=\"add-comment-39486767\" class=\"\" data-placeholdertext=\"Use comments to reply to other users or notify them of changes. If you are adding new information, edit your post instead of commenting.\" style=\"display: none;\"><table><tbody><tr><td><textarea name=\"comment\" cols=\"68\" rows=\"3\" placeholder=\"Use comments to reply to other users or notify them of changes. If you are adding new information, edit your post instead of commenting.\"></textarea></td><td><input tabindex=\"0\" type=\"submit\" value=\"Add Comment\"><br><a tabindex=\"0\" class=\"comment-help-link\">help</a></td></tr><tr><td colspan=\"2\"><span class=\"text-counter cool\">enter at least 15 characters</span><span class=\"form-error\"></span></td></tr></tbody></table></form>\n"
" </td>\n"
" </tr>\n"
" </tfoot>\n"
" </table>\n"
" </div>\n\n"
" <div id=\"comments-link-39486767\" title=\"expand to show all comments on this post, or add one of your own\" style=\"opacity: 1; display: block;\">\n\n"
" <a class=\"js-add-link comments-link\" title=\"Use comments to reply to other users or notify them of changes. If you are adding new information, edit your post instead of commenting.\" href=\"#\">add a comment</a><span class=\"js-link-separator\"> | </span>\n"
" <a class=\"js-show-link comments-link\" title=\"expand to show all comments on this post\" href=\"#\" onclick=\"\">show <b>1</b> more comment</a>\n"
" </div> \n"
" </td>\n"
"</tr> <tr>\n"
" <td class=\"votecell\"></td>\n"
" <td>\n"
" <div style=\"margin-top:20px\">\n"
" <a id=\"bounty-link bounty\" href=\"/help/bounty\" title=\"offer some of your reputation for better answers\">\n"
"question eligible for bounty <span title=\"2016-09-16 09:19:04Z\" class=\"relativetime-clean\">in 2 days</span> </a>\n"
" </div>\n"
" </td>\n"
" </tr>\n"
" </tbody></table>\n"
"</div>\n\n"
" <div id=\"answers\" class=\"no-answers\">\n\n"
" <a name=\"tab-top\"></a>\n"
" <div id=\"answers-header\">\n"
" <div class=\"subheader answers-subheader\">\n"
" <h2>\n"
" </h2>\n"
" <div style=\"display:none;\">\n"
" <div id=\"tabs\">\n"
" <a href=\"/questions/39486767/increase-regex-performance-when-matching-only-if-not-in-html-attribute?answertab=active#tab-top\" data-nav-xhref=\"\" title=\"Answers with the latest activity first\" data-value=\"active\" data-shortcut=\"A\">\n"
" active</a>\n"
" <a href=\"/questions/39486767/increase-regex-performance-when-matching-only-if-not-in-html-attribute?answertab=oldest#tab-top\" data-nav-xhref=\"\" title=\"Answers in the order they were provided\" data-value=\"oldest\" data-shortcut=\"O\">\n"
" oldest</a>\n"
" <a class=\"youarehere\" href=\"/questions/39486767/increase-regex-performance-when-matching-only-if-not-in-html-attribute?answertab=votes#tab-top\" data-nav-xhref=\"\" title=\"Answers with the highest score first\" data-value=\"votes\" data-shortcut=\"V\">\n"
" votes</a>\n"
"</div>\n"
" </div>\n"
" </div> \n"
" </div> \n\n\n\n"
" <h2 class=\"bottom-notice bottom-share-links\" style=\"padding-top: 8px; margin-bottom: -8px;\">\n"
" Know someone who can answer? \n"
" Share a link to this <a href=\"/q/39486767/5422107\">question</a> via <a href=\"mailto:?subject=Stack%20Overflow%20Question&body=Increase%20regex%20performance%20when%20matching%20only%20if%20not%20in%20html%20attribute%0Ahttp%3a%2f%2fstackoverflow.com%2fq%2f39486767%2f5422107%3fsem%3d2\">email</a>, <a href=\"https://plus.google.com/share?url=http%3a%2f%2fstackoverflow.com%2fq%2f39486767%2f5422107%3fsgp%3d2\">Google+</a>, <a href=\"http://twitter.com/share?url=http%3a%2f%2fstackoverflow.com%2fq%2f39486767%2f5422107%3fstw%3d2\">Twitter</a>, or <a href=\"http://www.facebook.com/sharer.php?u=http%3a%2f%2fstackoverflow.com%2fq%2f39486767%2f5422107%3fsfb%3d2\">Facebook</a>.\n"
" </h2>\n"
" <a name=\"new-answer\"></a>\n"
" <form id=\"post-form\" action=\"/questions/39486767/answer/submit\" method=\"post\" class=\"dno post-form\">\n"
" <input type=\"hidden\" id=\"post-id\" value=\"39486767\">\n"
" <input type=\"hidden\" id=\"qualityBanWarningShown\" name=\"qualityBanWarningShown\" value=\"false\">\n"
" <input type=\"hidden\" name=\"referrer\" value=\"http://stackoverflow.com/posts/39486767/edit\">\n"
" <h2 class=\"space\">Your Answer</h2>\n\n\n"
" <script>\n"
" StackExchange.ifUsing(\"editor\", function () {\n"
" StackExchange.using(\"externalEditor\", function () {\n"
" StackExchange.using(\"snippets\", function () {\n"
" StackExchange.snippets.init();\n"
" });\n"
" });\n"
" }, \"code-snippets\");\n"
" </script>\n"
" \n\n"
"<script>\n"
" StackExchange.ready(function() {\n"
" initTagRenderer(\"\".split(\" \"), \"\".split(\" \"));\n"
" \n"
" StackExchange.using(\"externalEditor\", function() {\n"
" // Have to fire editor after snippets, if snippets enabled\n"
" if (StackExchange.settings.snippets.snippetsEnabled) {\n"
" StackExchange.using(\"snippets\", function() {\n"
" createEditor();\n"
" });\n"
" }\n"
" else {\n"
" createEditor();\n"
" }\n"
" });\n\n"
" function createEditor() {\n"
" prepareEditor({\n"
" heartbeatType: 'answer',\n"
" convertImagesToLinks: false,\n"
" reputationToPostImages: null,\n"
" bindNavPrevention: true,\n"
" postfix: \"\",\n"
" onDemand: false,\n"
" discardSelector: \".discard-answer\"\n"
" \n"
" });\n"
" \n\n"
" }\n"
" }); \n"
"</script>\n\n\n"
"<div id=\"post-editor\" class=\"post-editor js-post-editor\">\n\n"
" <div style=\"position: relative;\"> \n"
" <div class=\"wmd-container\">\n"
" <div id=\"wmd-button-bar\" class=\"wmd-button-bar\"></div>\n"
" <textarea id=\"wmd-input\" class=\"wmd-input\" name=\"post-text\" cols=\"92\" rows=\"15\" tabindex=\"101\" data-min-length=\"\"></textarea>\n"
" </div>\n"
" </div>\n\n"
" <div class=\"fl\" style=\"margin-top: 8px; height:24px;\"> </div>\n"
" <div id=\"draft-saved\" class=\"draft-saved community-option fl\" style=\"margin-top: 8px; height:24px; display:none;\">draft saved</div>\n\n"
" <div id=\"draft-discarded\" class=\"draft-discarded community-option fl\" style=\"margin-top: 8px; height:24px; display:none;\">draft discarded</div>\n\n"
" <div class=\"community-option\">\n"
" <input id=\"communitymode\" name=\"communitymode\" type=\"checkbox\">\n"
" <label for=\"communitymode\" title=\"Marking an answer community wiki encourages others to edit it by lowering the reputation barrier required to edit. However, you will not gain any upvote reputation from it. This cannot be undone.\">community wiki</label>\n"
" </div>\n\n\n"
" <div id=\"wmd-preview\" class=\"wmd-preview\"></div>\n"
" <div></div>\n"
" <div class=\"edit-block\">\n"
" <input id=\"fkey\" name=\"fkey\" type=\"hidden\" value=\"163fdb769ceeb49041bd469392682033\">\n"
" <input id=\"author\" name=\"author\" type=\"text\">\n"
" </div>\n\n\n\n"
"</div>\n"
" <div style=\"position: relative;\">\n"
" \n"
" \n"
" </div>\n"
" \n"
" <div class=\"form-submit cbt\">\n"
" <input id=\"submit-button\" type=\"submit\" value=\"Post Your Answer\" tabindex=\"110\">\n"
" <a href=\"#\" class=\"btn-clear discard-answer dno\">discard</a>\n"
" </div>\n"
" </form>\n"
" <div id=\"show-editor-button\" class=\"form-submit\">\n"
" <input type=\"button\" value=\"Answer Your Question\" data-confirm-text=\"Are you sure you want to answer your own question?\n\n"
" If you're responding to answers left on your question, enter comments under each answer.\n\n"
" If you need to add details to your question, use the edit link under your question.\" data-confirm-use-fancy=\"True\" data-confirm-fancy-title=\"Are you sure you want to answer your question?\" data-confirm-fancy-body=\"<b>Comment</b> if you're trying to respond to an answer. <br/><br/> <b>Edit your question</b> if you need to add more details. <br/><br/>\" data-confirm-fancy-accept-button=\"Yes, I want to post an answer\">\n"
" </div>\n"
" <script>\n"
" StackExchange.ready(function () {\n"
" $(\"#show-editor-button input\").click(function () {\n"
" var showEditor = function() {\n"
" $(\"#show-editor-button\").hide();\n"
" $(\"#post-form\").removeClass(\"dno\");\n"
" StackExchange.editor.finallyInit();\n"
" };\n\n"
" var useFancy = $(this).data('confirm-use-fancy');\n"
" if(useFancy == 'True') {\n"
" var popupTitle = $(this).data('confirm-fancy-title');\n"
" var popupBody = $(this).data('confirm-fancy-body');\n"
" var popupAccept = $(this).data('confirm-fancy-accept-button');\n"
" \n"
" $(this).loadPopup({\n"
" url: '/post/self-answer-popup',\n"
" loaded: function(popup) {\n"
" var pTitle = $(popup).find('h2');\n"
" var pBody = $(popup).find('.popup-body');\n"
" var pSubmit = $(popup).find('.popup-submit');\n\n"
" pTitle.text(popupTitle);\n"
" pBody.html(popupBody);\n"
" pSubmit.val(popupAccept).click(showEditor);\n"
" }\n"
" })\n"
" } else{\n"
" var confirmText = $(this).data('confirm-text');\n"
" if (confirmText ? confirm(confirmText) : true) {\n"
" showEditor();\n"
" }\n"
" }\n"
" });\n"
" });\n"
" </script>\n\n\n\n"
"<div>\n"
" <h2 class=\"bottom-notice\">\n"
" Would you like to have responses to your questions <a id=\"inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19\" href=\"#\">sent to you via email</a>?\n"
" </h2>\n"
" <div id=\"inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-container\" style=\"display: none; \">\n"
" <div>\n"
" <input type=\"checkbox\" id=\"inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-enable\">\n"
" <label for=\"inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-enable\">\n"
" Email me my unread inbox messages\n"
" </label>\n"
" <select id=\"inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-freq\">\n"
" <option value=\"3\">every 3 hours</option>\n"
" <option value=\"24\">daily</option>\n"
" <option value=\"168\">weekly</option>\n"
" </select>\n"
" </div>\n"
" <div>\n"
" Send emails to\n"
" <input id=\"inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-address\" style=\"width: 300px;\" value=\"yannick@herminet.com\">\n"
" </div>\n"
" <div>\n"
" <input class=\"email-save\" type=\"button\" value=\"Save email settings\" disabled=\"disabled\">\n"
" </div>\n"
" <div class=\"email-confirmation\"></div>\n"
" <hr>\n"
" </div>\n"
"</div>\n"
"<script>\n"
" StackExchange.ready(function () {\n"
" var inboxSettingsShown = false;\n"
" $(\"#inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19\").click(function () {\n"
" var ec = $('#inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-container');\n"
" var btn = ec.find(\".email-save\");\n"
" var result = ec.find(\".email-confirmation\");\n"
" \n"
" var enableSave = function () {\n"
" btn.removeAttr(\"disabled\");\n"
" result.html('');\n"
" };\n\n"
" var disableSave = function () {\n"
" btn.attr(\"disabled\", \"disabled\");\n"
" };\n"
" disableSave();\n\n"
" if (ec.is(':visible')) {\n"
" ec.slideUp('fast');\n"
" } else {\n"
" if (!inboxSettingsShown) {\n"
" StackExchange.gps.track('inbox_settings.show', { location: 4 });\n"
" inboxSettingsShown = true;\n"
" }\n"
" ec.slideDown('fast');\n"
" }\n"
" \n"
" $(\"#inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-freq\").val(24).on(\"click focus\", function () { $(\"#inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-enable\").prop(\"checked\", true); });\n"
" $(\"#inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-address\").focus().keyup(enableSave);\n"
" $(\"#inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-enable, #inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-freq\").change(enableSave);\n\n"
" btn.click(function () {\n"
" var req =\n"
" {\n"
" email: $('#inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-address').val(),\n"
" fkey: StackExchange.options.user.fkey,\n"
" optin: $('#inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-enable').is(':checked'),\n"
" freq: $('#inbox-notify-f2027e84999a4bc9afd102ebf2ba6f19-freq').val(),\n"
" location: 4\n"
" };\n"
" ec.addSpinner();\n"
" $.post(\n"
" '/accounts/verified-email-set',\n"
" req,\n"
" function (data) {\n"
" ec.removeSpinner();\n"
" result.html(data.message).fadeIn();\n\n"
" if (data.success) disableSave();\n"
" },\n"
" 'json');\n"
" });\n\n"
" return false;\n"
" });\n"
" });\n"
"</script>\n\n"
" </div>\n"
" </div>\n"
" <div id=\"sidebar\" class=\"show-votes\">\n"
" <div class=\"module question-stats\">\n"
" <table id=\"qinfo\">\n"
" <tbody><tr>\n"
" <td>\n"
" <p class=\"label-key\">asked</p>\n"
" </td>\n"
" <td style=\"padding-left: 10px\">\n"
" <p class=\"label-key\" title=\"2016-09-14 09:19:04Z\"><b>today</b></p>\n"
" </td>\n"
" </tr>\n"
" <tr>\n"
" <td>\n"
" <p class=\"label-key\">viewed</p>\n"
" </td>\n\n"
" <td style=\"padding-left: 10px\">\n"
" <p class=\"label-key\">\n"
" <b>12 times</b>\n"
" </p>\n"
" </td>\n"
" </tr>\n"
" </tbody></table>\n"
" </div>\n"
" <div class=\"module community-bulletin\" data-tracker=\"cb=1\">\n"
" <div class=\"related\">\n"
" <div class=\"bulletin-title\">\n"
" Featured on Meta\n"
" </div>\n"
" <hr>\n"
" <div class=\"spacer\">\n"
" <div class=\"bulletin-item-type\">\n"
" <a href=\"http://meta.stackoverflow.com/questions/334404/documentation-update-september-12th?cb=1\" class=\"question-hyperlink\">\n"
"<div class=\"favicon favicon-stackoverflowmeta\" title=\"Meta Stack Overflow\"></div> </a>\n"
" </div>\n"
" <div class=\"bulletin-item-content\">\n"
" <a href=\"http://meta.stackoverflow.com/questions/334404/documentation-update-september-12th?cb=1\" class=\"question-hyperlink\">Documentation Update, September 12th</a>\n"
" </div>\n"
" <br class=\"cbt\">\n"
" </div>\n"
" <div class=\"bulletin-title\">\n"
" Hot Meta Posts\n"
" </div>\n"
" <hr>\n"
" <div class=\"spacer\">\n"
" <div class=\"bulletin-item-type\">\n"
" <span title=\"Vote score (upvotes - downvotes)\">23</span>\n"
" </div>\n"
" <div class=\"bulletin-item-content\">\n"
" <a href=\"http://meta.stackoverflow.com/questions/334468/why-fade-out-meta-answers-that-have-high-down-vote-count?cb=1\" class=\"question-hyperlink\">Why fade out meta answers that have high down-vote count?</a>\n"
" </div>\n"
" <br class=\"cbt\">\n"
" </div>\n"
" <div class=\"spacer\">\n"
" <div class=\"bulletin-item-type\">\n"
" <span title=\"Vote score (upvotes - downvotes)\">5</span>\n"
" </div>\n"
" <div class=\"bulletin-item-content\">\n"
" <a href=\"http://meta.stackoverflow.com/questions/334448/repurpose-the-s3-tag-synomym?cb=1\" class=\"question-hyperlink\">Repurpose the S3 tag synomym</a>\n"
" </div>\n"
" <br class=\"cbt\">\n"
" </div>\n"
" <div class=\"spacer\">\n"
" <div class=\"bulletin-item-type\">\n"
" <span title=\"Vote score (upvotes - downvotes)\">4</span>\n"
" </div>\n"
" <div class=\"bulletin-item-content\">\n"
" <a href=\"http://meta.stackoverflow.com/questions/334395/is-an-answer-i-wrote-really-that-unclear?cb=1\" class=\"question-hyperlink\">Is an answer I wrote really that unclear?</a>\n"
" </div>\n"
" <br class=\"cbt\">\n"
" </div>\n"
" </div>\n"
"</div> \n"
" <script>\n"
" var ados = ados || {}; ados.run = ados.run || [];\n"
" ados.run.push(function () { ados_add_placement(22,8277,\"adzerk1407900611\",[5,17,2221]).setZone(45); });\n"
" </script>\n"
" <div class=\"everyonelovesstackoverflow\" id=\"adzerk1407900611\"><div id=\"careersadsdoublehigh\" style=\"display:none;\"></div><img height=\"0px\" width=\"0px\" border=\"0\" style=\"position: absolute; display: none !important;\" src=\"http://engine.adzerk.net/i.gif?e=eyJhdiI6NDE0LCJhdCI6NSwiYnQiOjAsImNtIjo5MjEsImNoIjoxMTc4LCJjayI6e30sImNyIjoyNjg4LCJkaSI6IjhjYzA5ZjM0NzA3YTQ0YjY4ZmI5ZGQyYTAxNzAxZWVkIiwiZG0iOjEsImZjIjoyNDg1LCJmbCI6MjY2MywiaXAiOiI4Ny4xMjguMTkuMTIiLCJrdyI6InBocCxodG1sLHJlZ2V4LHR5cG8zLHgtdXNlci1yZWdpc3RlcmVkLHgtMjAwcGx1cy1yZXAiLCJudyI6MjIsInBjIjowLCJlYyI6MCwicHIiOjYxNzM3LCJydCI6MSwicmYiOiJodHRwOi8vc3RhY2tvdmVyZmxvdy5jb20vcG9zdHMvMzk0ODY3NjcvZWRpdCIsInN0Ijo4Mjc3LCJ1ayI6InVlMS0xZDhhODRjYmU0YjA0OWI3YmJmNjAzYjU2YmRjMDYzNCIsInpuIjo0NSwidHMiOjE0NzM4NDY1NTEyOTYsImJmIjp0cnVlLCJwbiI6ImFkemVyazE0MDc5MDA2MTEiLCJmcSI6MH0&s=QZUx3KyKAgGqSy918GX1gRlwg5o\"></div>\n"
" <div id=\"hireme\" class=\" tagthemedphp tag-themed php tagged clc-jobs-multi\"><a href=\"//stackoverflow.com/jobs/tag/php\" target=\"_blank\" data-at=\"0\" data-tz=\"1\" data-ti=\"11\" class=\"top \"><span>Want a <span class=\"header-tag\">php</span> job?</span></a><div class=\"middle\"><ul class=\"jobs\"><li class=\"clc-dismissable\"><div class=\"job-wrap\"><a class=\"job\" data-at=\"0\" data-tz=\"3\" data-ti=\"219449\" href=\"//stackoverflow.com/jobs/119449/lead-software-engineer-for-seo-php-trivago\" target=\"_blank\" title=\"Lead Software Engineer for SEO – PHP at trivago. Click to learn more.\"><div class=\"title\">Lead Software Engineer for SEO – PHP</div><div><span class=\"company\">trivago</span><span class=\"location\">Düsseldorf, Germany</span></div><div class=\"opts\"><span class=\"opt relocate\">Relocation</span></div><span class=\"post-tag highlight\">php</span><span class=\"post-tag\">javascript</span></a></div><a class=\"clc-dismiss clc-non-ad\" data-clc-url=\"//clc.stackoverflow.com/dismiss-job\" data-clcparam-cid=\"219449\" data-clcparam-ac=\"7085060\" data-clc-tooltip=\"dismiss this job\"><span class=\"clc-tooltip above-left\">dismiss this job</span></a></li><li class=\"clc-dismissable\"><div class=\"job-wrap\"><a class=\"job\" data-at=\"0\" data-tz=\"3\" data-ti=\"222672\" href=\"//stackoverflow.com/jobs/122672/php-software-developer-with-focus-on-backend-wikimedia-deutschland-ev\" target=\"_blank\" title=\"PHP Software Developer with focus on Backend at Wikimedia Deutschland e.V.. Click to learn more.\"><div class=\"title\">PHP Software Developer with focus on Backend</div><div><span class=\"company\">Wikimedia Deutschland e.V.</span><span class=\"location\">Berlin, Germany</span></div><span class=\"post-tag highlight\">php</span><span class=\"post-tag\">mysql</span></a></div><a class=\"clc-dismiss clc-non-ad\" data-clc-url=\"//clc.stackoverflow.com/dismiss-job\" data-clcparam-cid=\"222672\" data-clcparam-ac=\"7085060\" data-clc-tooltip=\"dismiss this job\"><span class=\"clc-tooltip above-left\">dismiss this job</span></a></li><li class=\"clc-dismissable\"><div class=\"job-wrap\"><a class=\"job\" data-at=\"0\" data-tz=\"3\" data-ti=\"224494\" href=\"//stackoverflow.com/jobs/124494/software-engineer-analytics-wikimedia-foundation\" target=\"_blank\" title=\"Software Engineer (Analytics) at Wikimedia Foundation. Click to learn more.\"><div class=\"title\">Software Engineer (Analytics)</div><div><span class=\"company\">Wikimedia Foundation</span><span class=\"location\">San Francisco, CA</span></div><div class=\"opts\"><span class=\"opt remote\">Remote</span></div><span class=\"post-tag highlight\">php</span><span class=\"post-tag\">javascript</span></a></div><a class=\"clc-dismiss clc-non-ad\" data-clc-url=\"//clc.stackoverflow.com/dismiss-job\" data-clcparam-cid=\"224494\" data-clcparam-ac=\"7085060\" data-clc-tooltip=\"dismiss this job\"><span class=\"clc-tooltip above-left\">dismiss this job</span></a></li><li class=\"clc-dismissable\"><div class=\"job-wrap\"><a class=\"job\" data-at=\"0\" data-tz=\"3\" data-ti=\"224627\" href=\"//stackoverflow.com/jobs/124627/web-entwickler-m-w-aktivshop-gmbh\" target=\"_blank\" title=\"Web Entwickler (m/w) at aktivshop GmbH. Click to learn more.\"><div class=\"title\">Web Entwickler (m/w)</div><div><span class=\"company\">aktivshop GmbH</span><span class=\"location\">Rheine, Deutschland</span></div><span class=\"post-tag highlight\">php</span><span class=\"post-tag\">jquery</span></a></div><a class=\"clc-dismiss clc-non-ad\" data-clc-url=\"//clc.stackoverflow.com/dismiss-job\" data-clcparam-cid=\"224627\" data-clcparam-ac=\"7085060\" data-clc-tooltip=\"dismiss this job\"><span class=\"clc-tooltip above-left\">dismiss this job</span></a></li></ul><div style=\"clear:both\"></div></div><img class=\"impression\" src=\"//clc.stackoverflow.com/soi.gif?an=Y2NiKFtQk9hy57IHA4tMDgMrI8MZdSZWAQZGBnZuBgYGFstIZoa4XZ48TNrP7VnB4owMQMTCDJIEMhn4QcSFVGYG6_v-vdPzXmGq4gKpYgUS73KYGR5Wiaxzf_jIngWiKgXFrOJcZgbNmP5DXzVewBQgjAGZwFByyX7Gj6PFi_a5AgA&at=0&pt=571\" style=\"display:none;\"></div>\n"
" <script>\n"
";(function(n){var u=Object.assign||function(n){for(var i,r,u,f,e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(i=0,r=e;i<r.length;i++){u=r[i];for(f in u)n[f]=u[f]}return n},r,t,i;try{if(typeof[].indexOf!=\"function\")return;if(r=[\"stackoverflow.com\",\"serverfault.com\",\"careers.stackoverflow.com\",\"blog.codinghorror.com\",\"joelonsoftware.com\",\"www.joelonsoftware.com\"],r[0]!==\"*\"&&r.indexOf(location.hostname)===-1)return;t=window;t.clc_opts=u({},n,window.clc_opts||{});t.clc_opts.autoload&&(t.clc_init=t.clc_init||[],t.clc_init.push(function(){return t.clc.load()}));i=document.createElement(\"script\");i.async=!0;i.src=t.clc_opts.lib;document.body.appendChild(i)}catch(f){}}).call(null, {\"az\":true,\"kt\":2000,\"tto\":true,\"autoload\":true,\"d\":{\"sb\":[\"hireme\",\"clc-sb\"],\"tlb\":[\"careers1\",\"clc-tlb\"],\"mlb\":[\"careers3\",\"clc-mlb\"]},\"allowed\":[\"stackoverflow.com\",\"serverfault.com\",\"careers.stackoverflow.com\",\"blog.codinghorror.com\",\"joelonsoftware.com\",\"www.joelonsoftware.com\"],\"h\":\"clc.stackoverflow.com\",\"u\":\"//clc.stackoverflow.com/p.js\",\"lib\":\"//cdn.sstatic.net/clc/clc.min.js?v=abefbc2bcc92\"}); </script>\n"
" \n\n"
" <div class=\"module sidebar-linked\">\n"
" <h4 id=\"h-linked\">Linked</h4>\n"
" <div class=\"linked\" data-tracker=\"lq=1\">\n\n"
"<div class=\"spacer\">\n"
" <a href=\"http://stackoverflow.com/q/1732348?lq=1\" title=\"Vote score (upvotes - downvotes)\">\n"
" <div class=\"answer-votes answered-accepted extra-large\">1326</div>\n"
" </a>\n"
" <a href=\"http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags?noredirect=1&lq=1\" class=\"question-hyperlink\">RegEx match open tags except XHTML self-contained tags</a>\n"
"</div> </div>\n"
"</div>\n\n"
" <div class=\"module sidebar-related\">\n"
" <h4 id=\"h-related\">Related</h4>\n"
" <div class=\"related js-gps-related-questions\" data-tracker=\"rq=1\">\n"
" <div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/70579?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes answered-accepted extra-large\">1268</div></a><a href=\"http://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html?rq=1\" class=\"question-hyperlink\">What are valid values for the id attribute in HTML?</a></div><div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/80357?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes answered-accepted large\">421</div></a><a href=\"http://stackoverflow.com/questions/80357/match-all-occurrences-of-a-regex?rq=1\" class=\"question-hyperlink\">Match All Occurrences of a Regex</a></div><div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/464913?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes answered-accepted default\">1</div></a><a href=\"http://stackoverflow.com/questions/464913/regex-to-match-attributes-in-html?rq=1\" class=\"question-hyperlink\">Regex to match attributes in HTML?</a></div><div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/1732348?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes answered-accepted extra-large\">1326</div></a><a href=\"http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags?rq=1\" class=\"question-hyperlink\">RegEx match open tags except XHTML self-contained tags</a></div><div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/1989851?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes answered-accepted default\">2</div></a><a href=\"http://stackoverflow.com/questions/1989851/regex-to-match-html-attributes?rq=1\" class=\"question-hyperlink\">Regex to match html attributes</a></div><div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/3617797?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes large\">149</div></a><a href=\"http://stackoverflow.com/questions/3617797/regex-to-match-only-letters?rq=1\" class=\"question-hyperlink\">Regex to match only letters</a></div><div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/5272604?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes answered-accepted default\">0</div></a><a href=\"http://stackoverflow.com/questions/5272604/regex-greedyness-matching-html-tags-content-and-attributes?rq=1\" class=\"question-hyperlink\">Regex - Greedyness - matching HTML tags, content and attributes</a></div><div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/6158764?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes default\">4</div></a><a href=\"http://stackoverflow.com/questions/6158764/matching-html-attributes-with-regex-in-php?rq=1\" class=\"question-hyperlink\">matching html attributes with regex in php</a></div><div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/20020658?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes answered-accepted default\">0</div></a><a href=\"http://stackoverflow.com/questions/20020658/regex-match-html-tag-and-attributes?rq=1\" class=\"question-hyperlink\">Regex match HTML tag and attributes</a></div><div class=\"spacer js-gps-track\"><a href=\"http://stackoverflow.com/q/27996281?rq=1\" title=\"Vote score (upvotes - downvotes)\"><div class=\"answer-votes default\">1</div></a><a href=\"http://stackoverflow.com/questions/27996281/php-regex-matching-html-tag-with-optional-attributes?rq=1\" class=\"question-hyperlink\">PHP regex matching <html> tag with optional attributes</a></div>\n"
" </div>\n"
" </div>\n"
" \n"
"<div id=\"hot-network-questions\" class=\"module\">\n"
" <h4>\n"
" <a href=\"//stackexchange.com/questions?tab=hot\" class=\"js-gps-track\" data-gps-track=\"posts_hot_network.click({ item_type:1, location:11 })\">\n"
" Hot Network Questions\n"
" </a>\n"
" </h4>\n"
" <ul>\n"
" <li>\n"
" <div class=\"favicon favicon-english\" title=\"English Language & Usage Stack Exchange\"></div><a href=\"http://english.stackexchange.com/questions/348217/hypernym-for-heard-seen-and-visited\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:97 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Hypernym for \"heard\", \"seen\", and \"visited\"\n"
" </a>\n\n"
" </li>\n"
" <li>\n"
" <div class=\"favicon favicon-stackoverflow\" title=\"Stack Overflow\"></div><a href=\"http://stackoverflow.com/questions/39484179/stdmutex-with-raii-but-finish-release-in-background-thread\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:1 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" std::mutex with RAII but finish & release in background thread\n"
" </a>\n\n"
" </li>\n"
" <li>\n"
" <div class=\"favicon favicon-worldbuilding\" title=\"Worldbuilding Stack Exchange\"></div><a href=\"http://worldbuilding.stackexchange.com/questions/55163/what-could-trigger-involuntary-mass-prosopagnosia\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:579 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" What could trigger involuntary mass prosopagnosia?\n"
" </a>\n\n"
" </li>\n"
" <li>\n"
" <div class=\"favicon favicon-scifi\" title=\"Science Fiction & Fantasy Stack Exchange\"></div><a href=\"http://scifi.stackexchange.com/questions/140348/why-doesnt-hogwarts-have-more-teachers\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:186 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Why doesn't Hogwarts have more teachers?\n"
" </a>\n\n"
" </li>\n"
" <li>\n"
" <div class=\"favicon favicon-unix\" title=\"Unix & Linux Stack Exchange\"></div><a href=\"http://unix.stackexchange.com/questions/309755/how-to-read-complete-grep-manual\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:106 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" How to read complete \"grep\" manual?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-history\" title=\"History Stack Exchange\"></div><a href=\"http://history.stackexchange.com/questions/32722/why-did-the-soviet-union-have-multiple-airplane-manufacturers\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:324 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Why did the Soviet Union have multiple airplane manufacturers?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-opensource\" title=\"Open Source Stack Exchange\"></div><a href=\"http://opensource.stackexchange.com/questions/4449/how-can-cheating-be-prevented-in-a-floss-multiplayer-game\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:619 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" How can cheating be prevented in a FLOSS multiplayer game?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-unix\" title=\"Unix & Linux Stack Exchange\"></div><a href=\"http://unix.stackexchange.com/questions/309533/how-to-tell-if-a-file-is-memory-mapped\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:106 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" How to tell if a file is memory mapped?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-mechanics\" title=\"Motor Vehicle Maintenance & Repair Stack Exchange\"></div><a href=\"http://mechanics.stackexchange.com/questions/36207/will-a-car-left-sitting-for-6-years-ever-run-again\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:224 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Will a car left sitting for 6 years ever run again?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-codegolf\" title=\"Programming Puzzles & Code Golf Stack Exchange\"></div><a href=\"http://codegolf.stackexchange.com/questions/93099/decode-the-chmod\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:200 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Decode the chmod\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-tex\" title=\"TeX - LaTeX Stack Exchange\"></div><a href=\"http://tex.stackexchange.com/questions/329404/tikz-forest-decorations-and-alignment\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:85 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" TikZ - Forest - Decorations and alignment\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-cs\" title=\"Computer Science Stack Exchange\"></div><a href=\"http://cs.stackexchange.com/questions/63403/is-the-halting-problem-decidable-for-pure-programs-on-an-ideal-computer\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:419 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Is the halting problem decidable for pure programs on an ideal computer?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-worldbuilding\" title=\"Worldbuilding Stack Exchange\"></div><a href=\"http://worldbuilding.stackexchange.com/questions/55049/could-you-populate-a-hospitable-planet-with-only-a-vial-of-dna\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:579 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Could you populate a hospitable planet with only a vial of DNA?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-puzzling\" title=\"Puzzling Stack Exchange\"></div><a href=\"http://puzzling.stackexchange.com/questions/42511/what-creature-am-i-strange-hybrid-creature\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:559 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" What creature am I? (Strange hybrid creature)\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-scifi\" title=\"Science Fiction & Fantasy Stack Exchange\"></div><a href=\"http://scifi.stackexchange.com/questions/140448/what-was-the-purpose-of-the-creation-of-the-ents\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:186 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" What was the purpose of the creation of the Ents?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-english\" title=\"English Language & Usage Stack Exchange\"></div><a href=\"http://english.stackexchange.com/questions/348040/is-there-an-idiom-for-disappointment-caused-due-to-last-minute-cancellation-of-p\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:97 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Is there an idiom for disappointment caused due to last minute cancellation of plans?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-stats\" title=\"Cross Validated\"></div><a href=\"http://stats.stackexchange.com/questions/234858/what-does-jim-simons-mean-by-never-override-the-computer\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:65 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" What does Jim Simons mean by \"never override the computer\"?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-worldbuilding\" title=\"Worldbuilding Stack Exchange\"></div><a href=\"http://worldbuilding.stackexchange.com/questions/54933/superheros-and-capes\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:579 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Superheros and capes\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-money\" title=\"Personal Finance & Money Stack Exchange\"></div><a href=\"http://money.stackexchange.com/questions/70601/getting-10-000-have-16-000-balance-on-two-credit-cards-how-to-allocate-paym\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:93 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Getting $10,000, have $16,000 balance on two credit cards - How to allocate payments?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-magento\" title=\"Magento Stack Exchange\"></div><a href=\"http://magento.stackexchange.com/questions/136209/magento-2-storemanagerinterface-already-exists-in-context-object-in-compilation\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:479 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Magento 2 StoreManagerInterface already exists in context object in compilation\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-security\" title=\"Information Security Stack Exchange\"></div><a href=\"http://security.stackexchange.com/questions/136739/aes-use-same-nonce-security-risk\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:162 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" AES use same Nonce security risk?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-rpg\" title=\"Role-playing Games Stack Exchange\"></div><a href=\"http://rpg.stackexchange.com/questions/87934/are-druids-shapechangers-for-the-purpose-of-a-polymorph-spell-saving-throw\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:122 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Are druids \"shapechangers\" for the purpose of a Polymorph spell saving throw?\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-space\" title=\"Space Exploration Stack Exchange\"></div><a href=\"http://space.stackexchange.com/questions/18178/why-do-some-rockets-not-ignite-all-their-engines-during-liftoff-gslv-mk3-lv\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:508 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" Why do some rockets not ignite all their engines during liftoff? (GSLV MK3 LV)\n"
" </a>\n\n"
" </li>\n"
" <li class=\"dno js-hidden\">\n"
" <div class=\"favicon favicon-puzzling\" title=\"Puzzling Stack Exchange\"></div><a href=\"http://puzzling.stackexchange.com/questions/42491/one-decent-visual-puzzle\" class=\"js-gps-track\" data-gps-track=\"site.switch({ item_type:11, target_site:559 }); posts_hot_network.click({ item_type:2, location:11 })\">\n"
" One Decent Visual Puzzle\n"
" </a>\n\n"
" </li>\n"
" </ul>\n\n"
" <a href=\"#\" class=\"show-more js-show-more js-gps-track\" data-gps-track=\"posts_hot_network.click({ item_type:3, location:11 })\">\n"
" more hot questions\n"
" </a>\n"
"</div>\n"
" </div>\n"
" \n"
"<div id=\"feed-link\">\n"
" <div id=\"feed-link-text\">\n"
" <a href=\"/feeds/question/39486767\" title=\"feed of this question and its answers\">\n"
" <span class=\"feed-icon\"></span>question feed\n"
" </a>\n"
" </div>\n"
"</div> <script>\n"
"StackExchange.ready(function(){$.get('/posts/39486767/ivc/2197');});\n"
"</script>\n"
"<noscript>\n"
" <div><img src=\"/posts/39486767/ivc/2197\" class=\"dno\" alt=\"\" width=\"0\" height=\"0\"></div>\n"
"</noscript><div style=\"display:none\" id=\"prettify-lang\">lang-php</div></div>\n\n\n"
" </div>\n"
" </div><script async=\"\" src=\"//cdn.sstatic.net/clc/clc.min.js?v=abefbc2bcc92\"></script>\n"
" <div id=\"footer\" class=\"categories\">\n"
" <div class=\"footerwrap\"> \n"
" <div id=\"footer-menu\">\n"
" <div class=\"top-footer-links\">\n"
" <a href=\"http://stackoverflow.com/company/about\">about us</a>\n"
" <a href=\"/tour\">tour</a>\n"
" <a href=\"/help\">help</a>\n"
" <a href=\"http://blog.stackoverflow.com?blb=1\">blog</a>\n"
" <a href=\"http://chat.stackoverflow.com\">chat</a>\n"
" <a href=\"http://data.stackexchange.com\">data</a>\n"
" <a href=\"http://stackexchange.com/legal\">legal</a>\n"
" <a href=\"http://stackexchange.com/legal/privacy-policy\">privacy policy</a>\n"
" <a href=\"http://stackoverflow.com/company/work-here\">work here</a>\n"
" <a href=\"http://stackexchange.com/mediakit\">advertising info</a>\n\n"
" <a onclick=\"StackExchange.switchMobile("on")\">mobile</a>\n"
" <b><a href=\"/contact\">contact us</a></b>\n"
" <b><a href=\"http://meta.stackoverflow.com\">feedback</a></b>\n"
" \n"
" </div>\n"
" <div id=\"footer-sites\">\n"
" <table>\n"
" <tbody><tr>\n"
" <th colspan=\"4\">\n"
" Technology\n"
" </th>\n"
" <th colspan=\"2\">\n"
" Life / Arts\n"
" </th>\n"
" <th colspan=\"2\">\n"
" Culture / Recreation\n"
" </th>\n"
" <th colspan=\"2\">\n"
" Science\n"
" </th>\n"
" <th>\n"
" Other\n"
" </th>\n"
" </tr>\n"
" <tr>\n"
" <td>\n"
" <ol>\n"
" <li><a href=\"//stackoverflow.com\" title=\"professional and enthusiast programmers\">Stack Overflow</a></li>\n"
" <li><a href=\"//serverfault.com\" title=\"system and network administrators\">Server Fault</a></li>\n"
" <li><a href=\"//superuser.com\" title=\"computer enthusiasts and power users\">Super User</a></li>\n"
" <li><a href=\"//webapps.stackexchange.com\" title=\"power users of web applications\">Web Applications</a></li>\n"
" <li><a href=\"//askubuntu.com\" title=\"Ubuntu users and developers\">Ask Ubuntu</a></li>\n"
" <li><a href=\"//webmasters.stackexchange.com\" title=\"pro webmasters\">Webmasters</a></li>\n"
" <li><a href=\"//gamedev.stackexchange.com\" title=\"professional and independent game developers\">Game Development</a></li>\n"
" <li><a href=\"//tex.stackexchange.com\" title=\"users of TeX, LaTeX, ConTeXt, and related typesetting systems\">TeX - LaTeX</a></li>\n"
" </ol></td><td><ol>\n"
" <li><a href=\"//programmers.stackexchange.com\" title=\"professional programmers interested in conceptual questions about software development\">Programmers</a></li>\n"
" <li><a href=\"//unix.stackexchange.com\" title=\"users of Linux, FreeBSD and other Un*x-like operating systems\">Unix & Linux</a></li>\n"
" <li><a href=\"//apple.stackexchange.com\" title=\"power users of Apple hardware and software\">Ask Different (Apple)</a></li>\n"
" <li><a href=\"//wordpress.stackexchange.com\" title=\"WordPress developers and administrators\">WordPress Development</a></li>\n"
" <li><a href=\"//gis.stackexchange.com\" title=\"cartographers, geographers and GIS professionals\">Geographic Information Systems</a></li>\n"
" <li><a href=\"//electronics.stackexchange.com\" title=\"electronics and electrical engineering professionals, students, and enthusiasts\">Electrical Engineering</a></li>\n"
" <li><a href=\"//android.stackexchange.com\" title=\"enthusiasts and power users of the Android operating system\">Android Enthusiasts</a></li>\n"
" <li><a href=\"//security.stackexchange.com\" title=\"information security professionals\">Information Security</a></li>\n"
" </ol></td><td><ol>\n"
" <li><a href=\"//dba.stackexchange.com\" title=\"database professionals who wish to improve their database skills and learn from others in the community\">Database Administrators</a></li>\n"
" <li><a href=\"//drupal.stackexchange.com\" title=\"Drupal developers and administrators\">Drupal Answers</a></li>\n"
" <li><a href=\"//sharepoint.stackexchange.com\" title=\"SharePoint enthusiasts\">SharePoint</a></li>\n"
" <li><a href=\"//ux.stackexchange.com\" title=\"user experience researchers and experts\">User Experience</a></li>\n"
" <li><a href=\"//mathematica.stackexchange.com\" title=\"users of Mathematica\">Mathematica</a></li>\n"
" <li><a href=\"//salesforce.stackexchange.com\" title=\"Salesforce administrators, implementation experts, developers and anybody in-between\">Salesforce</a></li>\n"
" <li><a href=\"//expressionengine.stackexchange.com\" title=\"administrators, end users, developers and designers for ExpressionEngine® CMS\">ExpressionEngine® Answers</a></li>\n"
" <li><a href=\"//crypto.stackexchange.com\" title=\"software developers, mathematicians and others interested in cryptography\">Cryptography</a></li>\n"
" </ol></td><td><ol>\n"
" <li><a href=\"//codereview.stackexchange.com\" title=\"peer programmer code reviews\">Code Review</a></li>\n"
" <li><a href=\"//magento.stackexchange.com\" title=\"users of the Magento e-Commerce platform\">Magento</a></li>\n"
" <li><a href=\"//dsp.stackexchange.com\" title=\"practitioners of the art and science of signal, image and video processing\">Signal Processing</a></li>\n"
" <li><a href=\"//raspberrypi.stackexchange.com\" title=\"users and developers of hardware and software for Raspberry Pi\">Raspberry Pi</a></li>\n"
" <li><a href=\"//codegolf.stackexchange.com\" title=\"programming puzzle enthusiasts and code golfers\">Programming Puzzles & Code Golf</a></li>\n"
" \n"
" <li>\n"
" <a href=\"http://stackexchange.com/sites#technology\" class=\"more\">\n"
" more (7)\n"
" </a>\n"
" </li>\n"
" </ol>\n"
" </td>\n"
" <td>\n"
" <ol>\n"
" <li><a href=\"//photo.stackexchange.com\" title=\"professional, enthusiast and amateur photographers\">Photography</a></li>\n"
" <li><a href=\"//scifi.stackexchange.com\" title=\"science fiction and fantasy enthusiasts\">Science Fiction & Fantasy</a></li>\n"
" <li><a href=\"//graphicdesign.stackexchange.com\" title=\"Graphic Design professionals, students, and enthusiasts\">Graphic Design</a></li>\n"
" <li><a href=\"//movies.stackexchange.com\" title=\"movie and tv enthusiasts\">Movies & TV</a></li>\n"
" <li><a href=\"//music.stackexchange.com\" title=\"musicians, students, and enthusiasts\">Music: Practice & Theory</a></li>\n"
" <li><a href=\"//cooking.stackexchange.com\" title=\"professional and amateur chefs\">Seasoned Advice (cooking)</a></li>\n"
" <li><a href=\"//diy.stackexchange.com\" title=\"contractors and serious DIYers\">Home Improvement</a></li>\n"
" <li><a href=\"//money.stackexchange.com\" title=\"people who want to be financially literate\">Personal Finance & Money</a></li>\n"
" </ol></td><td><ol>\n"
" <li><a href=\"//academia.stackexchange.com\" title=\"academics and those enrolled in higher education\">Academia</a></li>\n"
" \n"
" <li>\n"
" <a href=\"http://stackexchange.com/sites#lifearts\" class=\"more\">\n"
" more (8)\n"
" </a>\n"
" </li>\n"
" </ol>\n"
" </td>\n"
" <td>\n"
" <ol>\n"
" <li><a href=\"//english.stackexchange.com\" title=\"linguists, etymologists, and serious English language enthusiasts\">English Language & Usage</a></li>\n"
" <li><a href=\"//skeptics.stackexchange.com\" title=\"scientific skepticism\">Skeptics</a></li>\n"
" <li><a href=\"//judaism.stackexchange.com\" title=\"those who base their lives on Jewish law and tradition and anyone interested in learning more\">Mi Yodeya (Judaism)</a></li>\n"
" <li><a href=\"//travel.stackexchange.com\" title=\"road warriors and seasoned travelers\">Travel</a></li>\n"
" <li><a href=\"//christianity.stackexchange.com\" title=\"committed Christians, experts in Christianity and those interested in learning more\">Christianity</a></li>\n"
" <li><a href=\"//ell.stackexchange.com\" title=\"speakers of other languages learning English\">English Language Learners</a></li>\n"
" <li><a href=\"//japanese.stackexchange.com\" title=\"students, teachers, and linguists wanting to discuss the finer points of the Japanese language\">Japanese Language</a></li>\n"
" <li><a href=\"//gaming.stackexchange.com\" title=\"passionate videogamers on all platforms\">Arqade (gaming)</a></li>\n"
" </ol></td><td><ol>\n"
" <li><a href=\"//bicycles.stackexchange.com\" title=\"people who build and repair bicycles, people who train cycling, or commute on bicycles\">Bicycles</a></li>\n"
" <li><a href=\"//rpg.stackexchange.com\" title=\"gamemasters and players of tabletop, paper-and-pencil role-playing games\">Role-playing Games</a></li>\n"
" <li><a href=\"//anime.stackexchange.com\" title=\"anime and manga fans\">Anime & Manga</a></li>\n"
" \n"
" <li>\n"
" <a href=\"http://stackexchange.com/sites#culturerecreation\" class=\"more\">\n"
" more (18)\n"
" </a>\n"
" </li>\n"
" </ol>\n"
" </td>\n"
" <td>\n"
" <ol>\n"
" <li><a href=\"//math.stackexchange.com\" title=\"people studying math at any level and professionals in related fields\">Mathematics</a></li>\n"
" <li><a href=\"//stats.stackexchange.com\" title=\"people interested in statistics, machine learning, data analysis, data mining, and data visualization\">Cross Validated (stats)</a></li>\n"
" <li><a href=\"//cstheory.stackexchange.com\" title=\"theoretical computer scientists and researchers in related fields\">Theoretical Computer Science</a></li>\n"
" <li><a href=\"//physics.stackexchange.com\" title=\"active researchers, academics and students of physics\">Physics</a></li>\n"
" <li><a href=\"//mathoverflow.net\" title=\"professional mathematicians\">MathOverflow</a></li>\n"
" <li><a href=\"//chemistry.stackexchange.com\" title=\"scientists, academics, teachers and students\">Chemistry</a></li>\n"
" <li><a href=\"//biology.stackexchange.com\" title=\"biology researchers, academics, and students\">Biology</a></li>\n"
" <li><a href=\"//cs.stackexchange.com\" title=\"students, researchers and practitioners of computer science\">Computer Science</a></li>\n"
" </ol></td><td><ol>\n"
" <li><a href=\"//philosophy.stackexchange.com\" title=\"those interested in logical reasoning\">Philosophy</a></li>\n"
" \n"
" <li>\n"
" <a href=\"http://stackexchange.com/sites#science\" class=\"more\">\n"
" more (3)\n"
" </a>\n"
" </li>\n"
" </ol>\n"
" </td>\n"
" <td>\n"
" <ol>\n"
" <li><a href=\"//stackapps.com\" title=\"apps, scripts, and development with the Stack Exchange API\">Stack Apps</a></li>\n"
" <li><a href=\"//meta.stackexchange.com\" title=\"meta-discussion of the Stack Exchange family of Q&A websites\">Meta Stack Exchange</a></li>\n"
" <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\n"
" <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\n"
" \n"
" </ol>\n"
" </td>\n"
" </tr>\n"
"</tbody></table>\n"
" </div>\n"
" </div>\n"
" <div id=\"copyright\">\n"
" site design / logo © 2016 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \n"
" with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\n"
" </div>\n"
" <div id=\"svnrev\">\n"
" rev 2016.9.14.3977\n"
" </div>\n"
" </div>\n"
" </div>\n"
" <noscript>\n"
" <div id=\"noscript-warning\">Stack Overflow works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\n"
" </noscript>\n"
"<script>var p = \"http\", d = \"static\"; if (document.location.protocol == \"https:\") { p += \"s\"; d = \"engine\"; } var z = document.createElement(\"script\"); z.type = \"text/javascript\"; z.async = true; z.src = p + \"://\" + d + \".adzerk.net/ados.js\"; var s = document.getElementsByTagName(\"script\")[0]; s.parentNode.insertBefore(z, s);</script>\n"
"<script>\n"
" var ados = ados || {};\n"
" ados.run = ados.run || [];\n"
" \n"
" \n"
" \n"
" ados.run.push(function () {\n"
" setTimeout(function () { $(\"#adzerk-user-match\").remove(); }, window.AUMIframeDone ? 0 : 2000);\n"
" ados_setKeywords('php,html,regex,typo3,x-user-registered,x-200plus-rep');; ados_load();\n"
" }); \n"
" \n"
"</script>\n\n"
" <script>\n"
" (function(i, s, o, g, r, a, m) {\n"
" i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o),\n"
" m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m);\n"
" })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');\n"
" \n"
" ga('create', 'UA-5620270-1', {'userId': '7085060' });\n"
" ga('set', 'dimension1', '7085060'); ga('set', 'dimension2', '|php|html|regex|typo3|'); ga('send', 'pageview');\n"
" \n"
" var _qevents = _qevents || [],\n"
" _comscore = _comscore || [];\n"
" (function () {\n"
" var ssl='https:'==document.location.protocol,\n"
" s=document.getElementsByTagName('script')[0],\n"
" qc=document.createElement('script');\n"
" qc.async = true;\n"
" qc.src = (ssl ? 'https://secure' : 'http://edge') + '.quantserve.com/quant.js';\n"
" s.parentNode.insertBefore(qc, s);\n"
" _qevents.push({ qacct: \"p-c1rF4kxgLUzNc\" });\n"
" var sc=document.createElement('script');\n"
" sc.async=true;\n"
" sc.src=(ssl?'https://sb':'http://b') + '.scorecardresearch.com/beacon.js';\n"
" s.parentNode.insertBefore(sc, s);\n"
" _comscore.push({ c1: \"2\", c2: \"17440561\" });\n"
" })();\n\n"
" </script>\n"
" \n"
" \n"
" <script type=\"text/javascript\">\n"
" \n"
" (function(appendChild) {\n"
" Node.prototype.appendChild = function() {\n"
" var parent = this;\n"
" var newNode = arguments[0];\n"
" if (parent.nodeName === 'HEAD'\n"
" && newNode\n"
" && newNode.nodeName === 'SCRIPT'\n"
" && newNode.src) {\n"
" \n"
" window.setTimeout(function() {\n"
" var result = newNode.src.match(/^https:\\/\\/maps\\.googleapis\\.com\\/maps\\/api\\/place\\/js\\/(\\w+)Service\\./i) || [];\n"
" var service = result[1];\n"
" if (service) {\n"
" if (service === 'Autocompletion') service = 2;\n"
" else if (service === 'Place') service = 1;\n"
" else service = 0;\n"
" StackExchange.using('gps', function() {\n"
" StackExchange.gps.track('google_maps_places_api.call', { service: service });\n"
" });\n"
" }\n"
" }, 0);\n"
" }\n"
" return appendChild.apply(this, arguments);\n"
" };\n"
" })(Node.prototype.appendChild);\n"
" </script>\n"
" \n"
"<script async=\"\" src=\"//clc.stackoverflow.com/p.js?az=true&zones=1%3Dhireme&ac=7085060&tags=php%3Bhtml%3Bregex%3Btypo3&host=stackoverflow.com&lw=740&bw=2556\"></script></body></html>")
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