-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 Tester: Not matching correctly, Sql Select #885
Comments
Hello, From my understanding (please correct me if I'm wrong), when checking "Global" in Regex101, we get the same result than in DevToys, and DevToys behaves like if this Global option was checked. When this Global option is unchecked, Regex101 only matches the first line. Do you know if you had this option checked on regex101.com? I admit that in DevToys, it is not clear what behavior is expected. I'm planning to add this option in DevToys 2.0 (I'm currently working on it). Thanks |
That is quite interesting! Thanks for sharing! |
So, here is some good news 😁 First, the regex that was producing some odd highlighting compared to Regex101.com now behaves as on Regex101: Second, I added some colors to make the matches easier to group. Does that look better? Please note that this is a work in progress though. It's not done. |
Thank you very much for sharing! |
Current behavior
Using the Regex Tester to find a simple regex for a SQL select statement.
I settled for
^(SELECT|select)\s.*\s(FROM|from)\s.*\s(WHERE|where)(\s.*\s=\s.*\s)*$
with the follwoing test data:The first three lines match. The two last ones dont.
How to reproduce it (as minimally and precisely as possible)
Open the Regex Tester.
Paste above mentioned regex.
Paste above mentioned test data.
First three lines match.
Expected behavior
None of the lines should match. I ran my code with that regex, and everything failed.
I cross-checked the Regex with regex101.com and found out that the regex tested in DevToys should not work.
The correct regex is:
^(SELECT|select)\s.*\s(FROM|from)\s.*\s(WHERE|where)\s(.*=\s.*)+$
Screenshots
No response
Workaround
No response
Affected platforms
Windows
Affected DevToys kind
DevToys (app with GUI)
DevToys Version
Version 1.0.12.0 | X64 | RELEASE | 94bb821 | 94bb821
Relevant Assets/Logs
No response
The text was updated successfully, but these errors were encountered: