Skip to content

Conversation

@swarnat
Copy link

@swarnat swarnat commented Oct 20, 2025

Thanks for contributing!

Before submitting your pull request please have a look at the
following checklist:

  • ran the tests (pytest)
  • all style issues addressed (flake8)
  • your changes are covered by tests
  • your changes are documented, if needed

We use Django 4.2 and require sqlparse for parsing the SQL Query. (As part of the djongo library, we migrated to latest django version)
Now we got an error, by using case sensitive regex filter like "columnname REGEXP BINARY 'static.+[0-9]+'
I wasn't aware of such operator, but it exists and is used by Django, when regex must be case sensitive.

So I prepare a PR to implement support for this compare operator.
I'm not fully sure about the "\b" at the end, but it was there and probably it prevents to recognize something like "REGEXP binarystring" as operator. (Also when it isn't valid sql)

I'm open to adjust when something feels strange.

django use in mysql dialect the "REGEXP BINARY" compare operator.
Add tests for REGEXP and REGEXP BINARY SQL syntax.
Removed comments referencing issue 369 from test_regexp and test_regexp_binary functions.
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

Successfully merging this pull request may close these issues.

1 participant