- Notifications
You must be signed in to change notification settings - Fork53
Use environment variables to use std::regex#222
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lelit commentedDec 31, 2024
Thanks for the improvement. Ideally we should have a test case for the functionality, even just what you wrote above, but at a minimum I'd say we should expose the availability of StdRegex on the module, say What do you think? |
hkxs commentedJan 2, 2025
You're right it is good to have it exposed on the module, I added it (but I'm not sure if I should add something on typings/rapidjson/init.pyi, let me know if I'm missing something there). I also added an small test case to validate that we can use other regex when the variable is set |
RapidJson uses an in-houseregex enginethat has limited syntax, we can use
std::regexby definingThis patch extends that functionality to python-rapidjson by using the environmental variable
RAPIDJSON_SCHEMA_USE_STDREGEXFor example, the following schema uses negative-lookahead (not supported by default engine):
Using this schema leads to a ValidationError using this json
{"a": "a", "metadata": 1}:Expected behavior: