-
Notifications
You must be signed in to change notification settings - Fork 1k
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 containing umlauts in square brackets not matching #4922
Comments
The Erlang regex syntax can be a little unusual. In this case, I think the issue is that, as described in Square Brackets and Character Classes, you need to set Changing the query to: {
"selector": {
"lastname": {
"$regex": "(*UTF8)(?i)^m[ü]t"
}
}
} should give you the correct result. |
Awesome, thanks a lot 👍 |
Is this mentioned in the docs? |
the docs layout isn't great but we do link to the Erlang syntax for reference in https://docs.couchdb.org/en/stable/api/database/find.html#condition-operators. |
Description
I might be mistaken, but the following seems like a bug to me. Regexes that contain a German umlaut (or probably any other special character) wrapped between curly braces (like
^foo[ä]b
) won't match as expected, e.g. won't match the wordfooäbar
.Steps to Reproduce
Suppose you have the following user document in your database:
Try to run these queries against the
/_find
endpoint:Query 1:
Expected: returns above document
Actual: returns above document ✅
Query 2:
Expected: returns above document
Actual: returns above document ✅
Query 3:
Expected: returns above document
Actual: returns empty result ❌
According to my tests on Regex101 with PCRE, the last query should match the above document's
lastname
field, but for some reason doesn't.Your Environment
3
-tagged image)The text was updated successfully, but these errors were encountered: