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

Search Feature Fail #14874

Open
xTheWhiteTigerx opened this issue Mar 17, 2024 · 6 comments
Open

Search Feature Fail #14874

xTheWhiteTigerx opened this issue Mar 17, 2024 · 6 comments

Comments

@xTheWhiteTigerx
Copy link

Description of the Issue

Search feature fails when searching for the following line, which is confirmed to exist in the document:
html = f"{selected_email['body']}<img src='cid:image1'>"

Steps to Reproduce the Issue

  1. Open Notepad++
  2. Type html = f"{selected_email['body']}<img src='cid:image1'>"
  3. Press CTRL+F. Attempt to search for html = f"{selected_email['body']}<img src='cid:image1'>"

Expected Behavior

Search feature would find string.

Actual Behavior

Search feature failed to correctly find string in document.

Debug Information

v8.6.2, 64-bit

@alankilborn
Copy link
Contributor

Show screenshot of your Find window when this fails.

@xTheWhiteTigerx
Copy link
Author

image

@xTheWhiteTigerx
Copy link
Author

xTheWhiteTigerx commented Mar 17, 2024

I was able to resolve the bug by switching to Search Mode -> "Normal". However, given that I never chose "Regular expression" to begin with, the failure of the default Find feature, as well as the lack of any warning that "Regular expression" leads to irregular find results, is an unfortunate failure in what is otherwise a very good program.

@alankilborn
Copy link
Contributor

Switching to Regular expression search mode automatically uncheckmarks Match whole word only, which I suspect was your original problem (and why I asked for a screenshot). As the final character in your Find what text is NOT a "word character", this (having Match whole word only checkmarked) is problematic.

There's more information about this in the Notepad++ user manual -- accessible from Notepad++ on the ? menu.

@xTheWhiteTigerx
Copy link
Author

To be clear, the previous image was shown when Notepad++ failed to find the string. It failed because it was set to "Regular expression" instead of "Normal." I hope this clarifies things.

@alankilborn
Copy link
Contributor

It failed because it was set to "Regular expression" instead of "Normal." I hope this clarifies things.

Ah, okay, sorry for the misreading/misinterpretation on my part; let me start over. :-)


However, given that I never chose "Regular expression" to begin with...

You MUST have, at some point, chosen it, because it is not the default search mode. Normal is the default, for obvious reasons. If you change the Search mode, it will remain in that mode until you change it again.

The text data from your Find what will not match (in Regular expression mode) because of the [ and ] characters in that data (they are special regex metacharacters). What you are instructing search to do (I know, you didn't intentionally do this) is to match up to (but not including) the first [ literally, and then match any ONE single character from the set ', b, o, d, y, and then match the text following the ] literally.

Since you don't have something like e.g. html = f"{selected_emailb}<img src='cid:image1'>" in your document, it doesn't match.


I think that covers it and hopefully this issue may now be closed (by you, please).

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

2 participants