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

  • Home
  • SEARCH
  • 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 6066985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:33:33+00:00 2026-05-23T09:33:33+00:00

I am filtering (showing and hiding) a set of list items based on user’s

  • 0

I am filtering (showing and hiding) a set of list items based on user’s input. check it out here: http://jsfiddle.net/m5dzG/2/

Question:
Try inputing the word “comparison” you will see that the list hides except the ones that has the word “comparison” in them. good so far… but if you hit space and add more terms like the word “extrapolated” that is exist in that string it will find list items that have either of those words. What I want is AND not OR. basically I want to show the list item that has both those words in it. Because as you can imagine by putting more terms the list gets bigger not smaller.

I think the problem is in my regular expression in this line

var search_text = jQuery('#search').val();
var rg= new RegExp('('+$.unique(search_text.split(" ")).join("|")+')',"i");

any help would be appreciated.
Thanks

  • 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-05-23T09:33:34+00:00Added an answer on May 23, 2026 at 9:33 am

    Try this. It should make a string like this: ^(?=.*?honda)(?=.*?accord). This way, the string must have each of the terms somewhere in the string.

    var search_text = jQuery('#search').val();
    var rg= new RegExp('^(?=.*?'+$.unique(search_text.split(" ")).join(")(?=.*?")+')',"i");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am trying to do filtering part. Filtering means, when user selects some choices based
Am trying to do filtering part. Filtering means, when user selects some choices based
I want to filtering Items of one list and show result into another list.
When filtering a queryset, I'm wondering if the following are equivalent. User.objects.filter(username='josh').filter(email__startswith='josh') User.objects.filter(username='josh', email__startswith='josh')
Is it possible to set different texture filtering when working with sprites?
I'm filtering a big number of users based on attributes. For example, they can
In Short, I am currently showing a list of results... and then I place
ive got list of reports. for default, the report list will be showing all
I'm using named scopes to process some filtering actions, and the log is showing
I've created a view with a set filters exposed (to show filtering options in

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.