Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:03:47+00:00 2026-06-10T11:03:47+00:00

Please, whats the best way for checking if some text sentence have some of

  • 0

Please, whats the best way for checking if some text sentence have some of the keywords provided, and there could be 100 keywords.

For example:

var text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
var keywords = ["lorem", "sit", "elit", "sed do"];

Now whats the best and fastest way to check if any of keywords is in text, but like whole word not part of word, and its case-insensitive?

BTW Its Google Script, maybe there is some function which I didnt see :\

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:03:49+00:00Added an answer on June 10, 2026 at 11:03 am

    Try something on these lines.

    var text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
    var keywords = ["lorem", "sit", "elit", "sed do"];
    var words = text.split(/[\s,]+/); //Add all other delimiters you want to include. 
    for(var i in words){ 
       words[i] = words[i].toLowerCase(); 
    }
    for(var i in keywords){
      if(words.indexOf(keywords[i].toLowerCase()) != -1){
        Logger.log('Match found for ' + keywords[i]);
        break;
      }
    }
    

    Thanks to this post for splitting on multiple delimiters

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please let me know what is the best way to determine composition of young
Please clarify my queries regarding Singleton and Multithreading: What is the best way to
What's the best way to align icons (left) and text (right) or the opposite
Whats the best way to add an adornment layer to legacy controls, or in
Couple questions. Whats the best way to access a live .db file using sqlite
whats the best way to handle a complex param in a stored proc? let
Can you tell me please what is the best way to make garage collector
Im planning on adding a instructions view to my app. Whats the best way
Please have a look at this screenshot alt text http://www.maclife.com/files/u18/Yep3-big.jpg I think these are
What are your best tips for debugging Python? Please don't just list a particular

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.