-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Incomplete use of "Invalid regular expression" error message #6043
Comments
Some investigation in the code shows that for An example using
In running the code with the |
Probably related with this? |
Not related exactly, but I uncovered the "complaint" of this issue when researching that one. ;) My plan is to fix both, but this one first as it is easier. |
Similar thing as above for Replace All, Count and Mark All noted for
but |
Actual proof that NPP is a magical application. :) |
A replacement I was trying to do was making me crazy for a bit: Find: Notepad++ would perform the replacement but I didn't get what I wanted. There were 2 problems:
At first I thought that Next I thought that the unescaped It sure would be nice if Notepad++ could detect these problems in the replacement expression and alert the user... |
Description of the Issue
The error message
Find: Invalid regular expression
is used to alert the user to a syntax problem with their regular expression ONLY when aFind Next
action is invoked. An invalid-regular-expression message needs to be shown on the Find window's status bar whenever ANY type of find/replace/count/mark operation is initiated and the user's regular expression is malformed. (Obviously this applies only when the user sets theSearch mode
toRegular expression
.)Steps to Reproduce the Issue
abc[def
in theFind what
box. (This is a bad regex because the[
pattern metacharacter has no corresponding]
).Regular expression
for theSearch mode
.Find Next
button. Observe the Find window's status bar indicates in red:Find: Invalid regular expression
. (This is correct and desired behavior and is only shown here to contrast with the following incorrect behavior.)Count
button. Observe the Find window's status bar indicates in blue:Count: 0 matches
. The status bar at this point should indicate that the regular expression is invalid.Find Next
) that support regular expressions without changing theFind what
box data. Observe that none report on the invalidity of the regular expression, but rather indicate zero matches. [Indeed, a find-in-files operation in a big folder tree will work for a long time to report zero matches, when it should abort very quickly at the start to indicate that the regex is bad.]Expected Behavior
I expect to be told that my regular expression is not correct, and other search activities to be aborted. Zero matches is misleading when the true problem is that a search parameter is incorrect.
Actual Behavior
See 5 and 6 above in Steps to Repro...
Debug Information
Notepad++ v7.7.1 (32-bit)
Build time : Jun 16 2019 - 21:14:50
Path : C:............\npp.7.7.1.bin\notepad++.exe
Admin mode : OFF
Local Conf mode : ON
OS : Windows 10 (64-bit)
Plugins : ColumnTools.dll Explorer.dll LocationNavigate.dll MarkdownViewerPlusPlus.dll mimeTools.dll NppConverter.dll NppExec.dll NppExport.dll PythonScript.dll
The text was updated successfully, but these errors were encountered: