3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $html = <<< STR Sentence .. <div><div class="abc123"></div></div> .. bla bla Sun .. <div><div class="abc698"></div></div> .. bla bla <!DOCTYPE html> <html lang="en" dir="ltr" class="client-nojs"> <head> <meta charset="UTF-8" /> <title>International English Language Testing System - Wikipedia, the free encyclopedia</title> <meta name="generator" content="MediaWiki 1.25wmf2" /> <link rel="alternate" href="android-app://org.wikipedia/http/en.m.wikipedia.org/wiki/International_English_Language_Testing_System" /> <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=International_English_Language_Testing_System&amp;action=edit" /> <link rel="edit" title="Edit this page" href="/w/index.php?title=International_English_Language_Testing_System&amp;action=edit" /> <link rel="apple-touch-icon" href="//bits.wikimedia.org/apple-touch/wikipedia.png" /> <link rel="shortcut icon" href="//bits.wikimedia.org/favicon/wikipedia.ico" /> <link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Wikipedia (en)" /> <link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd" /> <link rel="alternate" hreflang="x-default" href="/wiki/International_English_Language_Testing_System" /> <link rel="copyright" href="//creativecommons.org/licenses/by-sa/3.0/" /> <link rel="alternate" type="application/atom+xml" title="Wikipedia Atom feed" href="/w/index.php?title=Special:RecentChanges&amp;feed=atom" /> <link rel="canonical" href="http://en.wikipedia.org/wiki/International_English_Language_Testing_System" /> <link rel="stylesheet" href="//bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&amp;lang=en&amp;modules=ext.gadget.DRN-wizard%2CReferenceTooltips%2Ccharinsert%2Cfeatured-articles-links%2CrefToolbar%2Cteahouse%7Cext.rtlcite%2Cwikihiero%2CwikimediaBadges%7Cext.uls.nojs%7Cext.visualEditor.viewPageTarget.noscript%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface%7Cmediawiki.ui.button%7Cskins.vector.styles%7Cwikibase.client.init&amp;only=styles&amp;skin=vector&amp;*" /> <meta name="ResourceLoaderDynamicStyles" content="" /> <link rel="stylesheet" href="//bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&amp;lang=en&amp;modules=site&amp;only=styles&amp;skin=vector&amp;*" /> <style>a:lang(ar),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none} /* cache key: enwiki:resourceloader:filter:minify-css:7:3904d24a08aa08f6a68dc338f9be277e */</style> <script src="//bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=vector&amp;*"></script> <script>if(window.mw){ mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"International_English_Language_Testing_System","wgTitle":"International English Language Testing System","wgCurRevisionId":628826419,"wgRevisionId":628826419,"wgArticleId":347577,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Use British English from June 2013","All articles with specifically marked weasel-worded phrases","Articles with specifically marked weasel-worded phrases from March 2014","Use dmy dates from June 2011","English language tests","English-language education","British Council"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"International_English_Language_Testing_System","wgIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgRedirectedFrom":"IELTS","wgWikiEditorEnabledModules":{"toolbar":true,"dialogs":true,"hidesig":true,"preview":false,"previewDialog":false,"publish":false},"wgBetaFeaturesFeatures":[],"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"isPageWatched":false,"pageLanguageCode":"en","pageLanguageDir":"ltr","svgMaxSize":4096,"namespacesWithSubpages":{"6":0,"8":0,"1":true,"2":true,"3":true,"4":true,"5":true,"7":true,"9":true,"10":true,"11":true,"12":true,"13":true,"14":true,"15":true,"100":true,"101":true,"102":true,"103":true,"104":true,"105":true,"106":true,"107":true,"108":true,"109":true,"110":true,"111":true,"447":true,"2600":false,"828":true,"829":true}},"wikilove-recipient":"","wikilove-anon":0,"wgHHVMStart":1412726400000,"wgULSAcceptLanguageList":["en-us","en"],"wgULSCurrentAutonym":"English","wgFlaggedRevsParams":{"tags":{"status":{"levels":1,"quality":2,"pristine":3}}},"wgStableRevisionId":null,"wgCategoryTreePageCategoryOptions":"{\"mode\":0,\"hideprefix\":20,\"showcount\":true,\"namespaces\":false}","wgNoticeProject":"wikipedia","wgInternalRedirectTargetUrl":"/wiki/International_English_Language_Testing_System","wgWikibaseItemId":"Q490396"}); }</script><script>if(window.mw){ mw.loader.implement("user.options",function($,jQuery){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"editfont":"default","editondblclick":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"math":0,"minordefault":0,"newpageshidepatrolled":0,"nickname":"","norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"rcdays":7,"rclimit":50,"rows":25,"showhiddencats":false,"shownumberswatching":1,"showtoolbar":1,"skin":"vector","stubthreshold":0,"thumbsize":4,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":1,"watchdefault":0,"watchdeletion":0,"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"watchrollback":0, "wllimit":250,"useeditwarning":1,"prefershttps":1,"flaggedrevssimpleui":1,"flaggedrevsstable":0,"flaggedrevseditdiffs":true,"flaggedrevsviewdiffs":false,"usebetatoolbar":1,"usebetatoolbar-cgd":1,"visualeditor-enable":0,"visualeditor-betatempdisable":0,"visualeditor-enable-experimental":0,"visualeditor-enable-language":0,"visualeditor-hidebetawelcome":0,"wikilove-enabled":1,"mathJax":false,"echo-subscriptions-web-page-review":true,"echo-subscriptions-email-page-review":false,"ep_showtoplink":false,"ep_bulkdelorgs":false,"ep_bulkdelcourses":true,"ep_showdyk":true,"echo-subscriptions-web-education-program":true,"echo-subscriptions-email-education-program":false,"echo-notify-show-link":true,"echo-show-alert":true,"echo-email-frequency":0,"echo-email-format":"html","echo-subscriptions-email-system":true,"echo-subscriptions-web-system":true,"echo-subscriptions-email-user-rights":true,"echo-subscriptions-web-user-rights":true,"echo-subscriptions-email-other":false, "echo-subscriptions-web-other":true,"echo-subscriptions-email-edit-user-talk":false,"echo-subscriptions-web-edit-user-talk":true,"echo-subscriptions-email-reverted":false,"echo-subscriptions-web-reverted":true,"echo-subscriptions-email-article-linked":false,"echo-subscriptions-web-article-linked":false,"echo-subscriptions-email-mention":false,"echo-subscriptions-web-mention":true,"echo-subscriptions-web-edit-thank":true,"echo-subscriptions-email-edit-thank":false,"echo-subscriptions-web-flow-discussion":true,"echo-subscriptions-email-flow-discussion":false,"gettingstarted-task-toolbar-show-intro":true,"uls-preferences":"","multimediaviewer-enable":true,"language":"en","variant-gan":"gan","variant-iu":"iu","variant-kk":"kk","variant-ku":"ku","variant-shi":"shi","variant-sr":"sr","variant-tg":"tg","variant-uz":"uz","variant-zh":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8": false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"searchNs100":false,"searchNs101":false,"searchNs108":false,"searchNs109":false,"searchNs118":false,"searchNs119":false,"searchNs446":false,"searchNs447":false,"searchNs710":false,"searchNs711":false,"searchNs828":false,"searchNs829":false,"searchNs2600":false,"gadget-teahouse":1,"gadget-ReferenceTooltips":1,"gadget-geonotice":1,"gadget-DRN-wizard":1,"gadget-charinsert":1,"gadget-refToolbar":1,"gadget-mySandbox":1,"gadget-featured-articles-links":1,"variant":"en"});},{},{});mw.loader.implement("user.tokens",function($,jQuery){mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\"});},{},{}); /* cache key: enwiki:resourceloader:filter:minify-js:7:8d55686787f352ccb6a28352f979b72d */ }</script> <script>if(window.mw){ mw.loader.load(["mediawiki.action.view.redirect","mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax","ext.centralauth.centralautologin","mmv.head","ext.visualEditor.viewPageTarget.init","ext.uls.init","ext.uls.interface","ext.centralNotice.bannerController","skins.vector.js"]); }</script> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <!--[if lt IE 7]><style type="text/css">body{behavior:url("/w/static-1.25wmf2/skins/Vector/csshover.min.htc")}</style><![endif]--> </head> <body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-International_English_Language_Testing_System skin-vector action-view vector-animateLayout"> <div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <div id="content" class="mw-body" role="main"> <a id="top"></a> <div id="siteNotice"><!-- CentralNotice --></div> <h1 id="firstHeading" class="firstHeading" lang="en"><span dir="auto">International English Language Testing System</span></h1> <div id="bodyContent" class="mw-body-content"> <div id="siteSub">From Wikipedia, the free encyclopedia</div> <div id="contentSub">(Redirected from <a href="/w/index.php?title=IELTS&amp;redirect=no" title="IELTS">IELTS</a>)</div> <div id="jump-to-nav" class="mw-jump"> Jump to: <a href="#mw-navigation">navigation</a>, <a href="#p-search">search</a> </div> <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><table class="infobox vevent" cellspacing="3" style="border-spacing:3px;width:22em;"> <caption class="summary">International English Language Testing System</caption> <tr> <td colspan="2" style="text-align:center;"><a href="/wiki/File:IELTS_logo.svg" class="image"><img alt="IELTS logo.svg" src="//upload.wikimedia.org/wikipedia/commons/thumb/7/7f/IELTS_logo.svg/300px-IELTS_logo.svg.png" width="300" height="113" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/7/7f/IELTS_logo.svg/450px-IELTS_logo.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/7/7f/IELTS_logo.svg/600px-IELTS_logo.svg.png 2x" data-file-width="778" data-file-height="293" /></a></td> </tr> <tr> <th scope="row" style="text-align:left;">Acronym</th> <td>IELTS</td> </tr> <tr> <th scope="row" style="text-align:left;">Type</th> <td>Standardized test. Available in 2 versions: "Academic" and "General training".</td> </tr> <tr> <th scope="row" style="text-align:left;">Developer / administrator</th> <td><a href="/wiki/Cambridge_English_Language_Assessment" title="Cambridge English Language Assessment">Cambridge English Language Assessment</a>, <a href="/wiki/British_Council" title="British Council">British Council</a>, <a href="/wiki/IDP_Education" title="IDP Education">IDP Education</a>.</td> </tr> <tr> <th scope="row" style="text-align:left;">Knowledge/skill(s) tested</th> <td>Listening, reading, writing and speaking of the <a href="/wiki/English_language" title="English language">English language</a>.</td> </tr> <tr> <th scope="row" style="text-align:left;">Purpose</th> <td>To assess the English language proficiency of non-native English speakers.</td> </tr> <tr> <th scope="row" style="text-align:left;">Duration</th> <td>Listening: 40 minutes,<br /> Reading: 60 minutes,<br /> Writing: 60 minutes,<br /> Speaking: 11–15 minutes.<br /> Total: about 3 hours.</td> </tr> <tr> </body> </html> STR; echo preg_replace('~(?is)(?:<div(?=\s)(?>(?:(?<=\s)class\s*=\s*"([^"]*)"|".*?"|\'.*?\'|[^>]*?)+>)|[&%](?:[a-z]+|(?:\#(?:[0-9]+|x[0-9a-f]+)));|<(?:(?:(?:(script|style|head|object|embed|applet|noframes|noscript|noembed)(?:\s+(?>".*?"|\'.*?\'|(?:(?!/>)[^>])?)+)?\s*>).*?</\2\s*(?=>))|(?:/?[\w:]+\s*/?)|(?:[\w:]+\s+(?:(?:(?:".*?")|(?:\'.*?\'))|(?:[^>]*?))+\s*/?)|\?.*?\?|(?:!(?:(?:DOCTYPE.*?)|(?:\[CDATA\[.*?\]\])|(?:--.*?--)|(?:ATTLIST.*?)|(?:ENTITY.*?)|(?:ELEMENT.*?))))>)~', '$1', $html);
based on mSbbY
Output for 5.6.0 - 7.2.0
Sentence .. abc123 .. bla bla Sun .. abc698 .. bla bla noprint noprint mw-body International English Language Testing System mw-body-content From Wikipedia, the free encyclopedia (Redirected from IELTS) mw-jump Jump to: navigation, search mw-content-ltr International English Language Testing System Acronym IELTS Type Standardized test. Available in 2 versions: "Academic" and "General training". Developer / administrator Cambridge English Language Assessment, British Council, IDP Education. Knowledge/skill(s) tested Listening, reading, writing and speaking of the English language. Purpose To assess the English language proficiency of non-native English speakers. Duration Listening: 40 minutes, Reading: 60 minutes, Writing: 60 minutes, Speaking: 11–15 minutes. Total: about 3 hours.