Ophir Lifshitz
Ophir Lifshitz
Hope you're doing better. Are you still interested in maintaining the project?
Did you try using a [non-capturing group](https://regular-expressions.mobi/brackets.html?wlr=1), like `(?:foo)`? Since this is an off-topic question about help with regular expressions, not an issue related to findAndReplaceDOMText, I believe it should...
I apologize. I read too fast, and realize now that my advice to use a non-capturing group was wrong. However, it's quite hard to fully understand your question from the...
FWIW, I had ported my code to [Fibrio](https://github.com/ethantw/fibrio) so I could use it easily on the server. The author of that project also refactored the code, so it might be...
@pjebs I am not aware of any, no. In my opinion, this is the main feature I would expect to bring the project up to a 1.0 milestone.
How about using a `replace` function? https://jsfiddle.net/zzby5zb6/2/ ```js findAndReplaceDOMText(document.querySelector("#test"), { find: /(hello)(world)/, replace: function replace(portion, match) { var txt = portion.text; if (portion.text === match[1]) txt += '!!!'; return document.createTextNode(txt);...
Could you post a fiddle with your unsimplified use case?
Change the if statement to ```js if (portion.indexInMatch + portion.text.length === match[1].length) ```
I'm interested in this feature as well, but I'll use that workaround for now.
I suppose I would use this `wrapAttrs` option if I could pass in an object of functions: ``` findAndReplaceDOMText(..., { find: /.../, wrap: 'mark', wrapAttrs: { 'class': 'match', 'data-index': function(portion,...