Skip to content

Matches gone after replacement #75

Description

@chiluap

Hi James,
I was wondering, is it possible to see what strings in the DOM matched the find: RegExp?
I am using the following options and would like to know which strings where matched.

var searchConfig = {
            find: new RegExp(pool.searchText, 'g'),
            wrap: wType || 'span',
            wrapClass: wClass || 'filter-number',
 };
var finder = findAndReplaceDOMText(domElement, searchConfig);

Since the matches are popped finder.matches is empty after execution.
Is there a way to seperate find and wrap function calls to extract the matches in beween?

If not I could implement some 'persistentMatches: true' flag that would write the matches into this.persistentMatches or so?

Keep up the awsome work.

Thank you

Christian

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions