A safer regex match.
# Using npm npm install --save match-it # Using yarn yarn add match-it
const matchIt = require("match-it"); let re = /(World|Mars)/; console.log(matchIt("Hello World!", re)); // => World console.log(matchIt("Hello Mars!", re)); // => Mars console.log(matchIt("Hello Pluto!", re)); // => undefined
There are few ways to get help:
Finds the regex matches in the string.
input: The string input.
re: The regular expression.
matchresult or an empty array.
Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like 🚀
Bitcoin—You can send me bitcoins at this address (or scanning the code below):
If you are using this library in one of your projects, add it in this list. ✨