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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:48:08+00:00 2026-05-19T01:48:08+00:00

In php, I have used preg_match_all() to find keywords (using the format %keyword%) in

  • 0

In php, I have used preg_match_all() to find keywords (using the format %keyword%) in a string, which works wonderfully and returns an array of all found keywords.

What I would like to do, is do the same thing using jQuery or javascript. I have tried using the filter() function, and it kind of works. But I think I am missing something.

How can I find ALL instances of the keyword in a string, using a regex?

Here is what I have worked out so far:

$("[id^='editableContent-']").filter(function() {
    alert($(this).html().match(/\%(.*?)\%/));
});

Any suggestions are welcome!

EDIT:

For anyone that reads this, I have figured out how to get my keywords into an array:

$("[id^='editableContent-']").filter(function() {
    var keys = $(this).html().match(/\%(.*?)\%/gi).toString();
    var keys_arr = keys.split(',');
    alert(keys_arr[1]);
});
  • 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-19T01:48:08+00:00Added an answer on May 19, 2026 at 1:48 am

    For anyone that reads this, I have figured out how to get my keywords into an array:

    $("[id^='editableContent-']").filter(function() {
        var keys = $(this).html().match(/\%(.*?)\%/gi).toString();
        var keys_arr = keys.split(',');
        alert(keys_arr[1]);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used to have PHP websites and using url rewriting on picture to have
I have quite a lot of PHP view files, which I used to include
I have used PHP for awhile now and have used it well with CodeIgniter,
I have recently used a PHP pagination tutorial, Pagination - what it is and
I am used to developing in PHP/MySQL and have no experience developing with SQL
Sessions in PHP seemed to have changed since the last time I used them,
Using PHP and/or Codeigniter, I want to create some string templates to be store
I have used a function for formatting in sentence case. My PHP script function
i have a php class method which determines whether if a class property have
I have never used php but have been asked to set up a site

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.