question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

markRegExp highlight individual groups?

See original GitHub issue

Hi!

Sorry to bother, but is it possible to highlight individual groups in a regular expression?

I am trying to make a custom HTML/custom syntax highlighter, and it seems, that the whole regex is highlighted. There is a parameter named ignoreGroups, but it does not help much, since there are also groups after the needed keyword.

Example text: Hello world [%test:value%] Regex: /(\[%)([a-z_]+):(.+?)(%])/g

As you can see in the example above, it’s hard to separately highlight the value and the %] part.

Maybe it is possible to make a separateGroups parameter, so that each callback will receive each group? Thanks in advance!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
julmotcommented, Aug 20, 2021

@evheny0 It’s on the master branch, actually. But, it’s not released yet. I just haven’t had time to take over the development again. However, maybe I’ll have the time in the next couple of weeks to release a new major version.

1reaction
julmotcommented, Nov 7, 2018

@Mottie Since this feature is coming from your end #183 could you please have a look at the issue mentioned from @danny0838?

Read more comments on GitHub >

github_iconTop Results From Across the Web

mark.js – JavaScript keyword highlight
js is a text highlighter written in JavaScript. It can be used to dynamically mark search terms or custom regular expressions and offers...
Read more >
How to highlight positive or negative numbers with mark.js ...
1 Answer 1 ... Also, you should group (non-capture) the '.###' part as a whole and put the ? for that group instead,...
Read more >
Versatile Keyword Highlighting Plugin For jQuery - mark.js
Supports regular expressions, diacritics, synonyms, custom class names, separate word search (multiple terms), filter selectors, word boundary ...
Read more >
Easy JavaScript Plugin For Word Highlighting In The Document
mark.js is a lightweight and easy-to-use JavaScript library used for highlighting specified words/strings/phrases in the selected element.
Read more >
mark.js - Bountysource
Mark.js will not highlight within an iframe, unless the context also ... Text doesn't get marked when it contains parentheses () using markRegExp...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found