Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Multiple substrings
(version: 0)
Comparing performance of:
String.match vs String.includes vs Regex.test
Created:
2 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var arr = ['in','no','of']; var pattern = new RegExp(arr.join('|'), 'iu'); var result = []; var strings = ["Pair your designer cowboy hat with scuba gear for a memorable occasion.","She had a habit of taking showers in lemonade.","Art doesn't have to be intentional.","We will not allow you to bring your pet armadillo along.","That was how he came to win $1 million.","The balloons floated away along with all my hopes and dreams.","When she didn�t like a guy who was trying to pick her up, she started using sign language.","She used her own hair in the soup to give it more flavor.","The knives were out and she was sharpening hers.","If you spin around three times, you'll start to feel melancholy.","The mysterious diary records the voice.","We need to rent a room for our party.","On each full moon","The manager of the fruit stand always sat and only sold vegetables.","She did her best to help him.","Today I dressed my unicorn in preparation for the race.","Shakespeare was a famous 17th-century diesel mechanic.","He ended up burning his fingers poking someone else's fire.","He was sitting in a trash can with high street class.","She did not cheat on the test, for it was not the right thing to do.","It was her first experience training a rainbow unicorn.","Before he moved to the inner city, he had always believed that security complexes were psychological.","She wanted to be rescued, but only if it was Tuesday and raining.","There can never be too many cherries on an ice cream sundae.","I am counting my calories, yet I really want dessert.","There's a growing trend among teenagers of using frisbees as go-cart wheels.","Your girlfriend bought your favorite cookie crisp cereal but forgot to get milk.","Tuesdays are free if you bring a gnome costume.","I only enjoy window shopping when the windows are transparent.","He wasn't bitter that she had moved on but from the radish.","Boulders lined the side of the road foretelling what could come next.","He watched the dancing piglets with panda bear tummies in the swimming pool.","Stop waiting for exceptional things to just happen.","He is no James Bond; his name is Roger Moore.","Baby wipes are made of chocolate stardust.","Harrold felt confident that nobody would ever suspect his spy pigeon.","A purple pig and a green donkey flew a kite in the middle of the night and ended up sunburnt.","Karen believed all traffic laws should be obeyed by all except herself.","The bug was having an excellent day until he hit the windshield.","When transplanting seedlings, candied teapots will make the task easier.","She was the type of girl that always burnt sugar to show she cared.","You bite up because of your lower jaw.","The sun had set and so had his dreams.","Fluffy pink unicorns are a popular status symbol among macho men.","I know many children ask for a pony, but I wanted a bicycle with rockets strapped to it.","He took one look at what was under the table and noped the hell out of there.","The quick brown fox jumps over the lazy dog.","David proudly graduated from high school top of his class at age 97.","The fish dreamed of escaping the fishbowl and into the toilet where he saw his friend go.","Eating eggs on Thursday for choir practice was recommended.","The thunderous roar of the jet overhead confirmed her worst fears.","He was an introvert that extroverts seemed to love.","He strives to keep the best lawn in the neighborhood.","He was willing to find the depths of the rabbit hole in order to be with her.","Erin accidentally created a new universe.","I cheated while playing the darts tournament by using a longbow.","The bird had a belief that it was really a groundhog.","The tree fell unexpectedly short.","I�m a living furnace.","Malls are great places to shop; I can find everything I need under one roof.","My biggest joy is roasting almonds while stalking prey.","The estate agent quickly marked out his territory on the dance floor.","The clouds formed beautiful animals in the sky that eventually created a tornado to wreak havoc.","She opened up her third bottle of wine of the night.","She found it strange that people use their cellphones to actually talk to one another.","Red is greener than purple, for sure.","Despite what your teacher may have told you, there is a wrong way to wield a lasso.","There are few things better in life than a slice of pie.","Joyce enjoyed eating pancakes with ketchup.","This is a Japanese doll.","Please tell me you don't work in a morgue.","The fish dreamed of escaping the fishbowl and into the toilet where he saw his friend go.","In hopes of finding out the truth, he entered the one-room library.","Art doesn't have to be intentional.","I'd rather be a bird than a fish.","It doesn't sound like that will ever be on my travel list.","There's a reason that roses have thorns.","The manager of the fruit stand always sat and only sold vegetables.","He put heat on the wound to see what would grow.","Combines are no longer just for farms.","He was sitting in a trash can with high street class.","Gary didn't understand why Doug went upstairs to get one dollar bills when he invited him to go cow tipping.","Grape jelly was leaking out the hole in the roof.","There were a lot of paintings of monkeys waving bamboo sticks in the gallery.","Nancy thought the best way to create a welcoming home was to line it with barbed wire.","Today we gathered moss for my uncle's wedding.","A kangaroo is really just a rabbit on steroids.","The best key lime pie is still up for debate.","While on the first date he accidentally hit his head on the beam.","The book is in front of the table.","Patricia loves the sound of nails strongly pressed against the chalkboard.","Charles ate the french fries knowing they would be his last meal.","For the 216th time, he said he would quit drinking soda after this last Coke.","The shark-infested South Pine channel was the only way in or out.","To the surprise of everyone, the Rapture happened yesterday but it didn't quite go as expected.","He picked up trash in his spare time to dump in his neighbor's yard.","As the rental car rolled to a stop on the dark road, her fear increased by the moment.","They did nothing as the raccoon attacked the lady�s bag of food.","If you like tuna and tomato sauce, try combining the two, it�s really not as bad as it sounds.","Her fragrance of choice was fresh garlic.","Henry couldn't decide if he was an auto mechanic or a priest.","I was very proud of my nickname throughout high school but today- I couldn’t be any different to what my nickname was.","He was all business when he wore his clown suit.","His mind was blown that there was nothing in space except space itself.","Hit me with your pet shark!","The sunblock was handed to the girl before practice, but the burned skin was proof she did not apply it.","The secret code they created made no sense, even to them.","His get rich quick scheme was to grow a cactus farm.","Doris enjoyed tapping her nails on the table to annoy everyone.","The sight of his goatee made me want to run and hide under my sister-in-law's bed.","When he asked her favorite number, she answered without hesitation that it was diamonds.","He fumbled in the darkness looking for the light switch, but when he finally found it there was someone already there.","Today I heard something new and unmemorable.","She finally understood that grief was her love with no place for it to go.","The balloons floated away along with all my hopes and dreams.","Never underestimate the willingness of the greedy to throw you under the bus.","There were white out conditions in the town; subsequently, the roads were impassable.","Instead of a bachelorette party","All they could see was the blue water surrounding their sailboat.","The clouds formed beautiful animals in the sky that eventually created a tornado to wreak havoc.","This made him feel like an old-style rootbeer float smells.","There's a message for you if you look up.","I'm not a party animal, but I do like animal parties.","She was the type of girl that always burnt sugar to show she cared.","The skeleton had skeletons of his own in the closet.","Combines are no longer just for farms.","I'd rather be a bird than a fish.","Waffles are always better without fire ants and fleas.","There are few things better in life than a slice of pie.","The door swung open to reveal pink giraffes and red elephants.","I am happy to take your donation; any amount will be greatly appreciated.","We have young kids who often walk into our room at night for various reasons including clowns in the closet.","Writing a list of random sentences is harder than I initially thought it would be.","His son quipped that power bars were nothing more than adult candy bars.","It doesn't sound like that will ever be on my travel list.","When transplanting seedlings, candied teapots will make the task easier.","Everyone pretends to like wheat until you mention barley.","I used to practice weaving with spaghetti three hours a day but stopped because I didn't want to die alone.","The busker hoped that the people passing by would throw money, but they threw tomatoes instead, so he exchanged his hat for a juicer.","He had concluded that pigs must be able to fly in Hog Heaven.","The sky is clear; the stars are twinkling.","Jim liked driving around town with his hazard lights on.","Behind the window was a reflection that only instilled fear.","The waitress was not amused when he ordered green eggs and ham.","Dolores wouldn't have eaten the meal if she had known what it actually was.","Three years later, the coffin was still full of Jello.","The Guinea fowl flies through the air with all the grace of a turtle.","I am my aunt's sister's daughter.","When money was tight, he'd get his lunch money from the local wishing well.","He is good at eating pickles and telling women about his emotional problems."];
Tests:
String.match
for (const str of strings) { if(str.match(pattern)) { result.push(str); } } console.log(result.length)
String.includes
for (const str of strings) { for (const word of arr) { if(str.includes(word)) { result.push(str); } } } console.log(result.length)
Regex.test
for (const str of strings) { if(pattern.test(str)) { result.push(str); } } console.log(result.length)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
String.match
String.includes
Regex.test
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
I'll do my best to answer your question without any distractions. It seems like you provided some text with various sentences, and you asked me to analyze or process them in some way. However, I don't see a clear question or task mentioned. If you could provide more context or clarify what you would like me to do with the text, I'll be happy to help.
Related benchmarks:
blackList vs regexp2 - expanded
RegEx.test vs. String.includes vs. String.match vs String.matchAll vs String.indexOf
String Array: Includes vs regex test vs indexOf
Test two string array if it has a matching lowercased string
Comments
Confirm delete:
Do you really want to delete benchmark?