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 feature not working consistently #264

Open
Gitoffthelawn opened this issue Jun 28, 2021 · 5 comments
Open

Regex ignore feature not working consistently #264

Gitoffthelawn opened this issue Jun 28, 2021 · 5 comments

Comments

@Gitoffthelawn
Copy link

Thank you for the new regex ignore feature. I've used it successfully in several cases.

But there is one case where it seems to never work. Here is the full regex:

[A-Z]{1,3}|x://\S+

and here is the part of the regex that won't work even by itself:

x://\S+

When I test this using Notepad++'s regex search, it works as expected to find strings. But the strings are still marked as misspelled even when trying to ignore them using a regex filter.

Example used for testing:

Correctly spelled
x://thisisanexample.com
x://thisisanotherexample.net
x://alltheseshouldnotbemarkedmisspelled.org
This is misspeeeeeled

IIRC, DSpellCheck didn't mark the x:// strings as misspelled until a recent change. But now, even with regex ignores, they still get marked as misspelled.

@Predelnik
Copy link
Owner

You need to show me all the advanced option tab to tell what is exactly wrong. Like this it seems to work for me:
image

The important thing to note here is that firstly words are split by the top options and then ignored by regex and other stuff, so for x://etc to be treated as word :,/ should stop being delimiters. It might not be the most intuitive thing but I don't know how to do it the other way.

IIRC, DSpellCheck didn't mark the x:// strings as misspelled until a recent change.

I don't know what you mean, don't remember doing anything like this, urls are ignored but they need to start with https? for it to work, not with x.

@Gitoffthelawn
Copy link
Author

You need to show me all the advanced option tab to tell what is exactly wrong. Like this it seems to work for me...

In the interest of time and clarity, I can provide the info you requested in written form faster than a screenshot.

The top dropdown is:

 "Split Words by Non-Alphabetic Characters except:"

The input field under it is:

'’_

The "Split CamelCase Words" checkbox is unchecked.

Everything else relevant is the same as your screenshot.

The important thing to note here is that firstly words are split by the top options and then ignored by regex and other stuff, so for x://etc to be treated as word :,/ should stop being delimiters. It might not be the most intuitive thing but I don't know how to do it the other way.

I think this is likely the issue. I'll add them to the input field below "Split Words by Non-Alphabetic Characters except" after I think about if that's going to cause unintended side-effects.

Although I favor intuitive design over UI's with explanations, an explanation (or UI redesign) might be warranted in this case.

IIRC, DSpellCheck didn't mark the x:// strings as misspelled until a recent change.

I don't know what you mean, don't remember doing anything like this, urls are ignored but they need to start with https? for it to work, not with x.

I think I figured out at some point why the change happened, but I'm scratching my noggin trying to remember. I can think of 3 possibilities:

  1. A change in Notepad++
  2. A change in DSpellCheck
  3. A change in my Notepad++ settings

I remember I had it working with URIs beginning with x:// not being spellchecked, and then suddenly, without me changing anything, all those "words" got marked as misspelled. That recollection reduces the chance of it being option 3, and your comment points at option 1 being the most likely (unless it was a change you made to DSpellCheck that had an unintended consequence).

@Predelnik
Copy link
Owner

Although I favor intuitive design over UI's with explanations, an explanation (or UI redesign) might be warranted in this case.

Well, I think firstly I need to describe it thoroughly in wiki which needs to be updated anyway. The thing is most of the spell-checkers don't give such options and just have one default behavior for splitting into words, but technically there are many ways to do that.

A change in Notepad++

There was clearly a change which made URLs highlighted differently internally, it was slightly buggy before, but I'm not sure that it has affected that x://... stopped being URLs, but it might have.

@mrobst
Copy link

mrobst commented Jul 13, 2021

Hi - I'm trying to use the regex ignore function to avoid spellchecking guids in a json document. I've put this regex in the ignore field : [a-zA-Z0-9-]{36}

The regex works with Notepad++ search function but for example still highlights this line as having a spelling issue on the "decb" part of the guid.

"groupId": "d6610d11-decb-482a-b3d7-0f5a437c0b8c",

Thanks for any input to resolve this.

@Predelnik
Copy link
Owner

@mrobst For this to work you need to make - part of the words, please add it to line edit on top of the settings as I've done on my screenshot for :, /. This is not a default because e.g. double dashes are used to split words usually so one might run into the problem if they would be treated as a part of the word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants