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
Apparent Test expression fail 2x #813
Comments
The first problem is with the "Whole word" option and the Adding the The second problem with the exception is an easy fix. Not clear why it happened here or hasn't come up as a problem before. |
After thinking about it some more, I don't think there is way to make the Whole word option work any better in regular expressions when the user-supplied expression starts or ends with a non-word character. So, I think I will leave the existing code as-is. For these cases, uncheck the whole word option and you have the full regex language to define the expression you need. |
That's nice, I wonder what code they have added to do that. Notepad++ disables 'Match whole word only' with regular expressions. So why have you enabled regular expressions? You aren't using a regular expression. You can always uncheck the Whole word option and supply your own regular expression to do exactly what you want. Maybe |
I'm not clear on what you are trying to show here? If you mean this to be a demonstration of whole word matching, then I think We already know that the I'm going to run some tests on other expressions to see if something works for the general case. Maybe something like this: |
i am attempting to show whole word matching can be performed by placing |
If you want to just a trailing For example, using just a trailing As for As I mentioned above, the existing dnGrep code for the past 13 years does this for whole word matches: I think this alternative will handle both cases:
These are grouping constructs, but not capture groups: |
After having spent hours on this... I now have this expression:
In addition to the normal whole word matches, it handles the cases where the pattern begins with or ends with punctuation, symbols, or spaces (where the pattern begins with or ends with something that normally signifies the start or end of a word). I added about 50 unit tests, including 20 that failed with the existing implementation, and now work with the pattern above. I'm sure I haven't begun to include all possibilities. So, it does fix with the original issue: It will match a pattern beginning with or ending with a non-word character immediately adjacent to a word character. But this is the same behavior you show above in Visual Studio. |
Added in v3.2.279 |
i must be stupid because to me it seems simple id est a word boundary i presume is just that exempli gratia as stated here learn Microsoft Word Boundary: \b . the notion of a |
Just one more thing - you opened this issue because the way dnGrep made a regex 'whole word' didn't work the way you wanted or expected. And that method was to add a |
Yes, you can write many different expressions to get what you want, but I can't write code that discerns what you intend when you enter any pattern and then say, 'make that a whole word, please'. The only thing the code can do is try make your entire pattern a 'whole word'. There is no way the code can go from a user entering I think the current solution is pretty good in that respect - as good as Visual Studio, I'd say. |
Greetings Kind Regards Thank You for dnGrep Attached please see GIF demonstrate two apparent Test expression failures i.e. to wit 1st failed to match "#include" 2nd failed to open dialog on 2nd attempt . Also please see log attached Thank You Kindly
Grep_Error_Log.zip
The text was updated successfully, but these errors were encountered: