Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex Ignore #27

Closed
bsell93 opened this issue Oct 28, 2016 · 12 comments
Closed

Regex Ignore #27

bsell93 opened this issue Oct 28, 2016 · 12 comments

Comments

@bsell93
Copy link

bsell93 commented Oct 28, 2016

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(\"........-....-....-....-...........\")"
]
@kentcdodds
Copy link

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

@Jason3S
Copy link
Collaborator

Jason3S commented Oct 31, 2016

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

@thorn0
Copy link

thorn0 commented Nov 18, 2016

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

@Jason3S
Copy link
Collaborator

Jason3S commented Jan 8, 2017

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+

@Jason3S
Copy link
Collaborator

Jason3S commented Jan 8, 2017

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

@jens1o
Copy link

jens1o commented Jan 8, 2017

Really helpful! Thanks 😄

@jreljac
Copy link

jreljac commented Mar 20, 2018

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

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 20, 2018

@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.

@jreljac
Copy link

jreljac commented Mar 20, 2018 via email

@Jason3S
Copy link
Collaborator

Jason3S commented Mar 21, 2018

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

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

@jreljac
Copy link

jreljac commented Mar 21, 2018 via email

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

6 participants