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 error? #505

Closed
Enzo4711 opened this issue May 17, 2021 · 4 comments
Closed

RegEx error? #505

Enzo4711 opened this issue May 17, 2021 · 4 comments

Comments

@Enzo4711
Copy link

Hello, maybe I discovered a RegEx error in V3.9.326.0
Using the built in Test Expression tool use "{$R *.dfm}" as sample text and then try the RegEx Expression "{$" (without quotes) it states that the expression is OK but you get an error message like "... too many )-chars". Using another Microsoft RegEx test software it works as expected and finds "{$".

@doug24
Copy link
Contributor

doug24 commented May 17, 2021

When I try, I don't get any error, and the expression \{\$ works for me. What am I doing differently?

@Enzo4711
Copy link
Author

Hm, don't understand why it suddenly works here in my Test window. I tried this way after not having success with the search engine for the same pattern.
Here is what I have now created here:

test.zip
dnGrep

test.pas (a simple Delphi/Pascal unit) is in my temporary directory aside with other files and directories. The dnGrep.png shows an OS's German error message I suppose. The "error" text translated to English is "...is getting analyzed - Too many )-characters".

Hope this helps.
Chris

@doug24
Copy link
Contributor

doug24 commented May 17, 2021

Thanks for the test file. Yes, that is a bug. There is code in dnGrep checking for the $ token, but isn't checking for the escape.

Long story - in the .net regular expression engine the $ token matches only the newline \n, but most files on Windows use \r\n. There were bug reports that the $ token wasn't working so I added code to modify the user's regular expression for them to work with \r\n. That code is missing the check for the escaped dollar sign.

@doug24
Copy link
Contributor

doug24 commented Jun 27, 2021

Fixed in Release 2.9.345

@doug24 doug24 closed this as completed Jul 4, 2021
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