inveniosoftware / dojson

Simple pythonic JSON to JSON converter.
https://dojson.readthedocs.io
Other
10 stars 29 forks source link

dojson: support for dashes in key #139

Closed kaplun closed 8 years ago

kaplun commented 8 years ago

@jirikuncar here's the test-case, however the proposed solution, breaks everything else...

kaplun commented 8 years ago

cc: @Panos512

kaplun commented 8 years ago

From Python documentation: https://docs.python.org/2/library/re.html

Similar to regular parentheses, but the substring matched by the group is accessible via the symbolic group name name. Group names must be valid Python identifiers, and each group name must be defined only once within a regular expression

So a different solution is needed in order to clean group names but being able afterwards to match them back. E.g. this could be done with an intermediate mapping.