Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
How to filter by not exact text JS

Here is a part of ag-grid JS code that filter cells with exactly text:

function doesExternalFilterPass(node) {
  switch (status) {
    case 'released':
      return node.data.Status == 'Released';
    case 'early-access':
      return node.data.Status == 'Early access';
    case 'in-development':
      return node.data.Status == 'In development';
    case 'rtt-strategy':
      return node.data.Genre == /.'RTT'./;
    default:
      return true;
  }
}

For example, one of the strings filter all cells containing Released in Status column, other containing RTT in Genre column. But I need that strings like RTT, RTS, Action also to be filtered. As I understand, I should use regular expressions, I try this

return node.data.Genre == /.'RTT'./;

but it doesn't work.

Any ideas to get many-words filtering?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  1. You don't need regex for this. Regex should be avoided, if possible. If I understand it correctly, you want to check if a string contains a substring. For that you can use String.prototype.includes() method: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes Example code:
case 'rtt-strategy':
  return node.data.Genre.includes('RTT');
  1. If you still want to use regex, then you can use the RegExp.prototype.test() method: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test. First of all, you really should look up how to use regex in js, because your example code is way off. Secondly, example code:
/RTT/.test(node.data.Genre)

Or if you want case insensitive, then:

/RTT/i.test(node.data.Genre)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!