Use environment variables to use std::regex#222
Use environment variables to use std::regex#222hkxs wants to merge 7 commits intopython-rapidjson:masterfrom
Conversation
|
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? |
Update README to set environmental variable to 1
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-house regex engine that 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: