Closed pejrak closed 7 years ago
Cool, thanks @pejrak. This is a good reference for anyone trying to do the same. I'm going to close this out but if there's additional action you'd like to take feel free to reopen.
Alright, this is probably isolated to my case/scenario. Please consider reviewing/adding if there is anyone else needing that. Thanks for the package and reply.
Did you want to incorporate this into the library? I didn't know because this is an Issue instead of a Pull Request.
Looking at the official String.prototype.replace docs it does seem that the official function is called with addition args. I would certainly be in support of mirroring that API since it's consistent with JS.
Maybe you could make a PR with your changes and we can discuss there?
Ian, I had other commitments last week, but I just added a pull request to my fork.
Let me see if I can write a test on this.
I suppose this is the offset from String.prototype.replace docs
Test added.
Published in v0.4. Thanks for the help on this one @pejrak
Hi, I your package helped me in a project where I wanted to wrap fields in a text. Fields were used to replace the matched strings with something else. However, I was missing the information about index of the match start character within the text. I will reference my solution.