-
Notifications
You must be signed in to change notification settings - Fork 264
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
Support question mark in idPattern in subscriptions #4098
Comments
That error message is generated at parsing stage at parseEntitiesVector() function (in parseEntitiesVector.cpp):
Thus, it is due to regcomp() function, which belongs to regex library |
Using regerror() we could probably get more information about the error. Moreover, we should use regerror() in everyplace we are currently using regcomp() |
After implementing that in PR #4100 we get the following error in CB logs:
The message "Invalid preceding regular expression" is generated by regex library. |
From https://stackoverflow.com/questions/71941687/regcomp-error-in-apparently-valid-regular-expression (it seems this link is no longer available in the public internet, as SOF people has closed the question as duplicate), in question comments:
Looking in that post: Another interesting piece of feedback in the comments:
But the cost of changing from regex.h to boost::regex needs to be evaluated. |
Some things to take into account:
|
Expression to test, provided by @danielvillalbamota
|
curl using that expression:
|
Is your feature request related to a problem / use case? Please describe.
Question mark
?
is not allowed in subscriptionidPattern
, e.g.^(?!avoid).*
, which means deny entityId which starts withavoid
.Following request gets a 400 error.
Error message: 400 Bad Request
The regex without question mark works.
Describe the solution you'd like
Allow this character to register this kind of regex.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Describe why you need this feature
Additional information
None
Do you have the intention to implement the solution
The text was updated successfully, but these errors were encountered: