Regexits is a lightweight npm package that handles a collection of commonly used regex patterns.
I suppose the answer is, you hate googling regex when you need to verify a SSN, PhoneNumber, or even URLSlug.
Well the good news is, that part is simple.
npm i regexits
Then in your code
const regexits= require('regexits') regexits(string, pattern)
- Date With Slashes
- Time in 24hr
- ISO8601 Date and time
- HTML tag
- HEX Color
- Src Img Tag
- Positive Int
- Negative Int
- Positive Num
- Negitive Num
- Phone Number
- New Line
- CSS Comment
- USA & Canada Zip
const regexits = require('regexits') let isSSN = regexits('012-34-5678', 'SSN') return isSSN; #This Returns true
So overall its a pretty flexible tool that covers a collection of Regex that is commonly used over and over again. I will continuously updating the npm package along with my other open source tools.
Want a new pattern added just go ahead and add an issue via github and I will add it and republish the npm package.
Want to keep up to date with the npm package? check it out over at npm