Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
case insensitive RegEx.test vs. String.includes vs. String.match – array of strings
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Browser:
Chrome 120
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
RegEx.test
5319.3 Ops/sec
String.includes
11184.1 Ops/sec
String.match
2426.1 Ops/sec
Script Preparation code:
var regex = /Hello/i; var strings = ["Home","Public","Questions","Tags","Users","Companies","Collectives","Explore","Collectives","Labs","Discussions","Teams","Stack","Overflow","for","Teams","–","Start","collaborating","and","sharing","organizational","knowledge.","Create","a","free","Team","Why","Teams?","Teams","Create","free","Team","Collectives™","on","Stack","Overflow","Find","centralized,","trusted","content","and","collaborate","around","the","technologies","you","use","most.","Learn","more","about","Collectives","Teams","Q&A","for","work","Connect","and","share","knowledge","within","a","single","location","that","is","structured","and","easy","to","search.","Learn","more","about","Teams","Get","early","access","and","see","previews","of","new","features.","Learn","more","about","Labs","Stack","Overflow","About","Products","For","Teams","Stack","Overflow","Public","questions","&","answers","Stack","Overflow","for","Teams","Where","developers","&","technologists","share","private","knowledge","with","coworkers","Talent","Build","your","employer","brand","Advertising","Reach","developers","&","technologists","worldwide","Labs","The","future","of","collective","knowledge","sharing","About","the","company","Loading…","current","community","Stack","Overflow","help","chat","Meta","Stack","Overflow","your","communities","Sign","up","or","log","in","to","customize","your","list.","more","stack","exchange","communities","company","blog","Log","in","Sign","up","StackExchange.ready(function","()","{","StackExchange.topbar.init();","});","StackExchange.scrollPadding.setPaddingTop(50,","10);","Find","the","best","answer","to","your","technical","question,","help","others","answer","theirs","Join","the","community","or","search","content","Want","a","secure,","private","space","for","your","technical","knowledge?","Discover","Teams","Every","developer","data","scientist","system","admin","mobile","developer","game","developer","has","a","tab","open","to","Stack","Overflow","100+","million","monthly","visitors","to","Stack","Overflow","&","Stack","Exchange","45.1+","billion","Times","a","developer","got","help","since","2008","191%","ROI","from","companies","using","Stack","Overflow","for","Teams","5,000+","Stack","Overflow","for","Teams","instances","active","every","day","A","public","platform","building","the","definitive","collection","of","coding","questions","&","answers","A","community-based","space","to","find","and","contribute","answers","to","technical","challenges,","and","one","of","the","most","popular","websites","in","the","world.","Join","the","community","or","search","content","A","private","collaboration","&","knowledge","sharing","SaaS","platform","for","companies","A","web-based","platform","to","increase","productivity,","decrease","cycle","times,","accelerate","time","to","market,","and","protect","institutional","knowledge.","Get","started","For","large","organizations","For","small","teams","Thousands","of","organizations","around","the","globe","use","Stack","Overflow","for","Teams","(function","()","{","var","logos","=","document.querySelector('.js-carousel-logos');","var","logosShown","=","4;","var","logosTotalPages","=","Math.ceil(logos.children.length","/","logosShown)","-","1;","var","logosCurrentPage","=","0;","var","logosCarouselTime","=","4000;","var","logosCarouselPlayer;","logos.classList.remove('o100');","for","(var","i","=","0;","i","<","logos.children.length;","++i)","{","logos.appendChild(logos.children[Math.random()","*","i","|","0]);","logos.children[i].classList.add('d-none');","}","var","logosCarouselNav","=","document.createElement('div');","logosCarouselNav.className","=","'ta-center","py12';","logos.parentNode.insertBefore(logosCarouselNav,","logos.nextSibling);","for","(var","i","=","0;","i","<=","logosTotalPages;","++i)","{","var","navEl","=","document.createElement('span');","navEl.className","=","'js-carousel-logos-nav","c-pointer","w24","h6","bg-black-200","h:bg-black-400","d-inline-block","bar-pill","my6","mx4';","navEl.setAttribute('data-page',","i);","navEl.addEventListener('click',","showLogos);","logosCarouselNav.appendChild(navEl);","}","function","updateNav()","{","var","navItems","=","document.querySelectorAll('.js-carousel-logos-nav');","for","(var","i","=","0;","i","<","navItems.length;","++i)","{","if","(i","===","logosCurrentPage)","{","navItems[i].classList.remove('bg-black-200');","navItems[i].classList.add('bg-black-800');","}","else","{","navItems[i].classList.add('bg-black-200');","navItems[i].classList.remove('bg-black-800');","}","}","}","function","showLogos(evt)","{","logos.classList.add('o0');","if","(evt)","{","clearInterval(logosCarouselPlayer);","logosCurrentPage","=","parseInt(evt.currentTarget.getAttribute('data-page')","||","0);","}","setTimeout(function()","{","for","(var","i","=","0;","i","<","logos.children.length;","++i)","{","if","(","(i",">=","logosShown","*","logosCurrentPage)","&&","(i","<","(logosShown","*","logosCurrentPage)","+","logosShown)",")","{","logos.children[i].classList.remove('d-none');","}","else","{","logos.children[i].classList.add('d-none');","}","}","logos.classList.remove('o0');","updateNav();","if","(logosCurrentPage",">=","logosTotalPages)","{","logosCurrentPage","=","0;","}","else","{","logosCurrentPage++;","}","},","300);","}","showLogos();","logosCarouselPlayer","=","setInterval(function()","{","showLogos();","},","logosCarouselTime);","})();","<img","width=\"1270\"","height=\"892\"","class=\"wmx100","w100","h-auto","d-block","btr-sm","bt","bc-orange-500","bs-lg\"","src=\"https://cdn.sstatic.net/Img/product/teams/screens/illo-question.png?v=14c5863a5550\"","alt=\"\">","<img","width=\"1270\"","height=\"892\"","class=\"wmx100","w100","h-auto","d-block","btr-sm","bbr-lg","bt","bc-orange-500","bs-lg\"","src=\"https://cdn.sstatic.net/Img/product/teams/screens/illo-for-you.png?v=ab49238abe04\"","alt=\"\">","<img","width=\"1270\"","height=\"892\"","class=\"wmx100","w100","h-auto","d-block","btr-sm","bt","bc-orange-500","bs-lg\"","src=\"https://cdn.sstatic.net/Img/product/teams/screens/illo-home-search.png?v=1ccd850cd929\"","alt=\"\">","Capture","your","company’s","knowledge","and","context","in","a","discoverable","format","to","unblock","your","team","Take","a","tour","of","Teams","Increase","productivity","If","somebody","somewhere","has","the","right","answer,","suddenly","you","have","it","too.","Collaborate","better","in","a","remote-first","world.","Accelerate","time","to","market","Shorten","the","time","between","initial","idea","and","complete","product.","Take","delays","and","misinformation","out","of","the","equation.","Protect","institutional","knowledge","People","come","and","people","go,","but","if","you","capture","their","contributions","in","one","central","place,","that","expertise","sticks","around.","Ensure","your","company","stays","on","course","Here","are","just","a","few","types","of","technologists","that","we","help.","DevOps","engineers","Shipping","new","products","and","features","requires","teamwork","and","coordination.","Forget","checklists","and","long","docs","no","one","ever","reads.","Data","scientists","Business","decisions","are","better","when","backed","by","data.","Give","visibility","to","the","data","that","support","your","strategies.","Software","engineers","Help","engineers","be","more","efficient","and","streamline","knowledge","sharing","using","a","tool","they","already","love","and","trust.","Support","teams","Level","up","your","support","by","providing","information","to","your","customers","using","a","natural","interface:","questions","and","answers.","Engineering","leaders","Help","your","team","get","the","information","they","need","to","do","their","job","-","reduce","burnout","and","help","engineers","grow","and","learn","together.","Annual","billing","discount","Free","Free","No","credit","card","required","ChatOps","integrations","-","Slack","&","Microsoft","Teams","Your","own","private","space","hosted","on","stackoverflowteams.com","Structured","and","searchable","knowledge","base","Create","a","free","Team","Always","free","up","to","50","teammates","Basic","$6.50","USD","$7.70","USD","per","teammate","/","month","Single","sign-on","(SSO)","with","SAML","+","Okta","integration","ChatOps","integrations","-","Slack","&","Microsoft","Teams","Your","own","private","space","hosted","on","stackoverflowteams.com","Structured","and","searchable","knowledge","base","Get","started","Up","to","250","teammates","Recommended","Business","$13.50","USD","$15.40","USD","per","teammate","/","month","All","the","features","of","Basic","plus…","Long-form","knowledge","with","Articles","Additional","integrations","—","ChatOps,","Jira,","GitHub","&","Okta","Group","content","together","into","Collections","Usage","and","adoption","metrics","Priority","customer","support","Content","Health","tools","Get","started","Unlimited","teammates","Enterprise","Custom","pricing","Let’s","talk","about","what","you","need","Premium","features","of","Business","plus…","Unlimited","Teams","within","your","instance","Flexible","hosting","options","—","cloud","or","on-premises","Robust","read","and","write","API","Your","own","customer","success","and","community","building","representative","99.5%","uptime","SLA","and","priority","support","Request","a","demo","Unlimited","teammates","(function","()","{","var","billingPeriodSwitch","=","document.querySelectorAll('input[name=\"billing-period\"]');","billingPeriodSwitch.forEach(function(radio)","{","radio.addEventListener('change',","function(e)","{","var","cycle","=","e.target.checked","?","'annually'",":","'monthly';","var","notCycle","=","e.target.checked","?","'monthly'",":","'annually';","document.querySelectorAll('.js-billed-'","+","cycle).forEach(function(price)","{","price.classList.remove('d-none');","});","document.querySelectorAll('.js-billed-'","+","notCycle).forEach(function(price)","{","price.classList.add('d-none');","});","});","});","})();","A","Forrester","Consulting","study","shows","191%","return","on","investment","with","Stack","Overflow","for","Teams.","The","world’s","largest","telecom","firm","saved","$10M","in","deflected","support","cases","with","our","centralized","knowledge","base.","Subject-matter","experts","at","software","platform","Unqork","had","27%","more","time","to","work","on","projects","after","using","Teams.","You","can","save","time","and","money","with","Stack","Overflow","for","Teams.","Calculate","your","ROI","<img","width=\"421\"","height=\"465\"","class=\"wmx100","h-auto","d-block\"","src=\"https://cdn.sstatic.net/Img/home/illo-integrations-left.png?v=0a97d470e180\"","alt=\"\">","Microsoft","Teams","Integrates","with","and","improves","other","tools","All","plans","come","with","integrations","for","ChatOps","tools","Slack","&","Microsoft","Teams","in","order","to","cut","down","on","pings,","limit","distractions","and","make","the","tools","even","more","powerful.","Business","and","Enterprise","customers","get","access","to","Jira,","GitHub","&","Okta","integrations.","Slack","Microsoft","Teams","GitHub","Jira","Okta","Slack","<img","width=\"421\"","height=\"465\"","class=\"wmx100","h-auto","d-block\"","src=\"https://cdn.sstatic.net/Img/home/illo-integrations-right.png?v=90c26b9154c7\"","alt=\"\">","Some","of","the","premium","features","available","with","paid","tiers","Robust","read","and","write","API","Single","sign-on","with","AD","or","SAML","Your","own","customer","success","representative","99.5%","uptime","SLA","and","priority","support","Stack","Overflow","for","Teams","has","been","a","resource","for","our","entire","company.","Not","only","for","developers","to","solve","problems,","it’s","also","enabled","our","sales","field","to","answer","technical","questions","that","help","them","close","deals.","Director","of","Product","Management","Microsoft","Engineers","should","help","solve","the","hardest","questions,","the","unknowns,","where","being","familiar","with","how","the","product","was","built","is","essential.","But","we","don’t","want","to","keep","answering","solved","problems","over","and","over","again.","That’s","where","Stack","Overflow","for","Teams","really","helps.","Director","of","Engineering","Elastic","Cloud","As","we","started","to","use","[Stack","Overflow","for","Teams]","and","saw","how","nice","it","was","to","have","a","repository","of","information,","we","started","to","see","it","spread","to","other","teams.","Our","customer","support","team","started","using","it,","our","people","success","team","started","using","it,","next","thing","we","knew,","we","had","[Slack]","integrations","all","over","the","place.","Engineering","Expensify","What","we","love","about","Stack","Overflow","for","Teams","is","that","it’s","a","very","dynamic","tool…there’s","just","so","many","ways","to","use","this","as","a","liaison","between","different","teams","and","different","knowledge","bases.","Software","Engineer","Box","Additional","products","that","reach","and","engage","developers","&","technologists…","Reach","the","world’s","largest","audience","of","developers","and","technologists","Connecting","communities","with","the","specific","technologies","they","use","the","most","Build","your","employer","brand","About","the","company","Want","to","work","here?","Current","job","openings","Ask","Different","Unix","&","Linux","Artificial","Intelligence","Software","Engineering","Ask","Ubuntu","Salesforce","Explore","technical","topics","and","other","disciplines","across","170+","Q&A","communities","From","Server","Fault","to","Super","User,","much","of","the","Stack","Exchange","network","continues","our","mission","to","empower","the","world","to","develop","technology","through","collective","knowledge.","Other","sites","on","the","Stack","Exchange","network","further","encourage","knowledge","sharing","across","topics","such","as","cooking","and","medicine.","Explore","the","network","Server","Fault","Super","User","Database","Administrators","Quantum","Computing","Game","Development","Network","Engineering","Build","a","private","community","to","share","technical","or","non-technical","knowledge.","Create","a","free","Team","window.onload","=","function","()","{","var","userSlider","=","document.querySelector(\".js-user-slider\");","var","userWordsData","=","userSlider.getAttribute(\"data-words\").split(\",\");","var","userWords;","var","userWordsWidth","=","[];","var","userSliderCount","=","0;","var","userSliderStarted","=","false;","var","userSliderTimeout;","var","userSliderPrev","=","null;","var","userSliderCur;","function","userSliderInit()","{","userSlider.innerHTML","=","\"\";","for","(var","i","=","0;","i","<","userWordsData.length;","++i)","{","var","_span","=","document.createElement(\"span\");","var","_text","=","document.createTextNode(userWordsData[i]);","var","_elm","=","_span.appendChild(_text);","userSlider.appendChild(_span);","}","userWords","=","userSlider.childNodes;","userSlider.style.width","=","userSlider.clientWidth","+","\"px\";","userSlider.style.height","=","userSlider.clientHeight","+","\"px\";","userSliderRun();","}","function","userSliderRun()","{","clearTimeout(userSliderTimeout);","userSliderTimeout","=","setTimeout(","function","()","{","userSlider.classList.add(\"js-loaded\");","userSliderStarted","=","true;","userSliderCur","=","userWords[userSliderCount];","if","(userSliderPrev)","{","userSliderPrev.classList.add(\"js-user-slide-out\");","userSliderCur.classList.remove(\"js-user-slide-out\");","userSliderCur.classList.add(\"js-user-slide-in\");","}","else","{","userSliderCur.classList.add(\"js-user-slide-init\");","}","userSlider.style.width","=","userSliderCur.clientWidth","+","\"px\";","userSlider.style.height","=","userSliderCur.clientHeight","+","\"px\";","userSliderPrev","=","userSliderCur;","if","(userSliderCount","===","userWords.length","-","1)","{","userSliderCount","=","0;","}","else","{","userSliderCount++;","}","userSliderRun();","},","userSliderStarted","?","2000",":","0",");","}","userSliderInit();","};","(function","()","{","var","useCases","=","document.querySelectorAll(\".js-use-case\");","var","useCaseClassActive","=","\"js-use-case","wmn3","fc-white","d:fc-black","js-use-case--is-active","c-pointer","flex--item","bg-black-700","d:bg-black-100","py32","bar-lg","bs-md\";","var","useCaseClass","=","\"js-use-case","c-pointer","fc-black-025","h:bg-black-800","bar-lg","flex--item","py32\";","var","useCaseCur","=","0;","var","useCasePlayer;","var","useCaseSpeed","=","5000;","for","(var","i","=","0;","i","<","useCases.length;","++i)","{","var","useCase","=","useCases[i];","useCase.addEventListener(\"click\",","function(event)","{","useCaseShow(event.currentTarget,","i);","clearInterval(useCasePlayer);","});","}","function","useCaseReset()","{","for","(var","i","=","0;","i","<","useCases.length;","++i)","{","useCases[i].className","=","useCaseClass;","}","}","function","useCaseShow(el)","{","useCaseReset();","el.className","=","useCaseClassActive;","}","function","useCaseInit()","{","useCasePlayer","=","setInterval(function()","{","if","(useCaseCur","===","useCases.length)","{","useCaseCur","=","0;","}","useCaseShow(useCases[useCaseCur++])","},","useCaseSpeed)","}","//useCaseInit();","})();","Stack","Overflow","Questions","Help","Products","Teams","Advertising","Collectives","Talent","Company","About","Press","Work","Here","Legal","Privacy","Policy","Terms","of","Service","Contact","Us","Cookie","Settings","Cookie","Policy","Stack","Exchange","Network","Technology","Culture","&","recreation","Life","&","arts","Science","Professional","Business","API","Data","Blog","Facebook","Twitter","LinkedIn","Instagram","Site","design","/","logo","©","2023","Stack","Exchange","Inc;","user","contributions","licensed","under","CC","BY-SA.","rev","2023.10.3.43657","window.dataLayer","=","window.dataLayer","||","[];","function","gtag()","{","dataLayer.push(arguments);","}","(function(i,","s,","o,","g,","r,","a,","m)","{","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),","m","=","s.getElementsByTagName(o)[0];","a.async","=","1;","a.src","=","g;","m.parentNode.insertBefore(a,","m);","})(window,","document,","'script',","'https://www.google-analytics.com/analytics.js',","'ga');","StackExchange.ready(function()","{","var","ga3Settings","=","{","autoLink:","[\"stackoverflow.blog\",\"info.stackoverflowsolutions.com\",\"stackoverflowsolutions.com\"],","sendTitles:","true,","tracker:","window.ga,","trackingCodes:","[","'UA-108242619-1'","],","checkDimension:","'dimension42'","};","var","customGA4Dimensions","=","{};","customGA4Dimensions[\"routename\"]","=","\"Home/Index\";","var","ga4Settings","=","{","tracker:","gtag,","trackingCodes:","[","'G-WCZ03SZFCQ'","],","consentsToPerformanceCookies:","\"granted\",","consentsToTargetingCookies:","\"granted\",","eventParameters:","customGA4Dimensions,","checkForAdBlock:","true,","sendTitles:","true,","trackClicks:","false,","};","StackExchange.ga.init({","GA3:","ga3Settings,","GA4:","ga4Settings","});","StackExchange.ga.setDimension('dimension3',","'Home/Index');","StackExchange.ga.setDimension('dimension7',","\"1696359684.2074797385\");","StackExchange.ga.trackPageView();","});"]
Tests:
RegEx.test
let i = 0; for (const s of strings) { if (regex.test(s)){ i++; } }
String.includes
let i = 0; for (const s of strings) { if (s.toLowerCase().includes("hello")){ i++; } }
String.match
let i = 0; for (const s of strings) { if (s.toLowerCase().match("hello")){ i++; } }