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 8040385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:52:42+00:00 2026-06-05T03:52:42+00:00

Based on Subhaze’s Function named filterScore … is just working fine if there is

  • 0

Based on Subhaze’s Function named “filterScore”… is just working fine if there is single value needs to be passed to KEY… But my question is what if there are multiple values needs to be parsed?

like for example there is a key named brand_id which is integer.. And I want to parse those data which have brand_id = 1 OR 3 OR 5 OR 7 (multiple) in JQuery RegExp, Filter, Match… Please help me out with this guyz!!

How can I do this??

Would really appreciate if anyone can help me with this

  • 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-05T03:52:43+00:00Added an answer on June 5, 2026 at 3:52 am

    As brands id are a list and not a pattern you can modify the filter function to accept brand_id as an array instead of a regex. New filter function would be

    function filterStore(dataStore, filter) {
        return $(dataStore).filter(function(index, item) {
            for( var i in filter ) {
                if(filter[i] instanceof Array){   
                  if($.inArray(parseInt(item[i],10),filter[i]) == -1)
                     return null;
                  else
                     continue;                  
                }
               if( ! item[i].toString().match( filter[i] ) ) return null;
            }
            return item;
        });
    }
    

    Then you can put all your brand id’s in a array like this

    var filter = {
        "brand_id": [1,2,3],
        "productname": new RegExp('(.*?)', 'gi'),
        "price": new RegExp('.*?', 'gi')
    };
    

    Working Example

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

Sidebar

Related Questions

Based on this question Fade in/out text based upon value of counter I have
Based on what I had read when I started working on the game that
Based on the function below, it is used to load data from file .dat.
Based on this post http://www.adam-bien.com/roller/abien/entry/ejb_3_1_killed_the I use in my app @Named @Stateless bean for
Based on the value entered into an edittext I am performing a select on
Based on my understanding: IIS invokes a single worker process for the whole asp.net
Based on my previous thread : RVM installed by Ruby not working? where i
Based on all my reading there should be one GC thread to invoke all
Based on following configuration I cannot enable ehcache statistics on xml file. There is
Based on the manual as follows: http://api.jquery.com/attr/ attr( attributeName, value ) I should be

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.