Vscode-spell-checker: Regex Ignore

Created on 28 Oct 2016  Â·  11Comments  Â·  Source: streetsidesoftware/vscode-spell-checker

Is it possible to add words to our settings.json that are regex and it ignores words that match it?
For example new Guid("........-....-....-....-...........") or any regex that is desired.
So settings something like

"cSpell.words": [
    "new Guid(\"........-....-....-....-...........\")"
]
Done / Fixed enhancement

Most helpful comment

I am looking into a more general solution. That would also solve #3 and possibly #24.

All 11 comments

This may also be handy for another thing I was about to suggest. I don't want URLs to be spell checked. For example:

screen shot 2016-10-31 at 9 32 16 am

I am looking into a more general solution. That would also solve #3 and possibly #24.

I also would like to have this feature to disable spell-checking for CSS colors like #cccccc.

With 0.14.0, it is now possible to define RegExp to be ignored:

"cSpell.ignoreRegExpList": [
    "0x[0-9A-F]+",
    "#[0-9A-F]+",
    "file:\\S+"
]

or you can add as a comment in the source file:

// cSpell:ignoreRegExp 0x[0-9A-F]+
// cSpell:ignoreRegExp #[0-9A-F]+
// cSpell:ignoreRegExp file:\S+
// cSpell:ignoreRegExp https?:\S+

If you want enhancements to how this works, please open a new issue and refer to this one.

Really helpful! Thanks 😄

Is it possible to ignore anything starting with $?

I've tried a number of different regex options with no luck, even tried getting help on StackOverflow: https://stackoverflow.com/q/49386209/99401

@jreljac,
I answered it on stackoverflow:

"cSpell.ignoreRegExpList": [
    "^\\$.+"
]

The .+ at the end of the string is necessary to match till the end of the line.

Thanks Jason...

That works...unless the line is indented, then it does not work.
$fullpath = $path . '/test/';
shows that fullpath is spelled wrong.

If I add what you recommended to my user settings file it works but if I
have
$fullpath = $path . '/test/'; (with a leading tab) it sill shows fullpath
as spelled wrong.
$fullpath = $path . '/test/'; (with one leading space) does the same.

I'm guessing it looks at the entire line...?
Jason

On Tue, Mar 20, 2018 at 12:02 PM, Jason Dent notifications@github.com
wrote:

I answered it on stackoverflow:

"cSpell.ignoreRegExpList": [
"^\$.+"
]

The .+ at the end of the string is necessary to match till the end of the
line.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Jason-Rev/vscode-spell-checker/issues/27#issuecomment-374653733,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB9yH6bH_mU9VPRGpIOTe6mZCbhXTvT3ks5tgSf6gaJpZM4KjuDY
.

I misunderstood what you were looking for. You want to ignore all words starting with $.

"cSpell.ignoreRegExpList": [
    "\\$\\w+"
]

Jason,

Perfect! Thanks for the help on this.

J-

On Wed, Mar 21, 2018 at 1:29 PM, Jason Dent notifications@github.com
wrote:

I misunderstood what you were looking for. You want to ignore all words
starting with $.

"cSpell.ignoreRegExpList": [
"\$\w+"
]

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Jason-Rev/vscode-spell-checker/issues/27#issuecomment-375028948,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB9yHyFkEXzGkQHYACdrQ67YXC6W6sgSks5tgo4MgaJpZM4KjuDY
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gandalfsaxe picture gandalfsaxe  Â·  5Comments

ahmadyousefdev picture ahmadyousefdev  Â·  3Comments

Deilan picture Deilan  Â·  3Comments

honghui-qiao picture honghui-qiao  Â·  3Comments

romines picture romines  Â·  3Comments