tbroadley / spellchecker-cli

A command-line tool for spellchecking files.
MIT License
119 stars 16 forks source link

Regex to avoid all words between {{ and }} #79

Closed s1mrankaur closed 2 years ago

s1mrankaur commented 2 years ago

I would like to know how can all words between {{ and }} be ignored by the spellchecker.

I tried with [A-Za-z]+}}

but it doesn't seem to use }} or {{ for some reason.

How can this be fixed?

tbroadley commented 2 years ago

Hello! I don't think spellchecker-cli's ignore regexes support this case. They're only intended to ignore specific words that match a regex, not multi-word sections of a document.

One option would be to first run a separate tool (e.g. sed) on the files you want to spellcheck, to remove everything between {{ and }}. Then you could run the files through this tool.

tbroadley commented 2 years ago

I've updated the README to make this clearer: https://github.com/tbroadley/spellchecker-cli/commit/e0ccde97e9262f6154212f4f58fec97da1320228