not.word is not defined
darsh-agrawal71 opened this issue Β· comments
π The bug
In the docs it is written not
can be prefixed before word, wordChar, wordBoundary, digit, whitespace, letter, letter.lowercase, letter.uppercase, tab, linefeed or carriageReturn.
But when i used it in my javascript project it returns undefined
Steps to reproduce:
- create new
index.js
- run
npm init -y
- install magic-regexp package
4:
import {not} from 'magic-regexp'
//const regexp = createRegExp(not.word.times); <- error
console.log(Object.keys(not).includes('word')) //false
console.log(Object.keys(not).includes('wordChar')) //true
π οΈ To reproduce
https://stackblitz.com/edit/github-cr7ofh?file=index.mjs
π Expected behaviour
Expected that not.word would not be undefined as it was in the docs
βΉοΈ Additional context
No response
Hi @darsh-agrawal71,
Thanks for reporting this issue, I believe this was an oversight while I was updating the docs, but after some thoughts, we should be able to add not.word
as RegExp \b\W+\b
, will make a PR soon π