Skip to content
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

Managing square brackets in dictionary keys #188

Open
gioarma opened this issue Jun 16, 2023 · 0 comments
Open

Managing square brackets in dictionary keys #188

gioarma opened this issue Jun 16, 2023 · 0 comments

Comments

@gioarma
Copy link

gioarma commented Jun 16, 2023

I'm having trouble working with a dictionary with keys containing square brackets. From the docs I see that square brackets are considered as elements of regular exporessions. However, this is causing the issue in my case, because I just want them to be "normal" square brackets.

Code example

import dpath

d = {'Position': {'Position x [mm]': 3}}
dpath.search(d, 'Position/Position x [mm]/*')

This outputs: {} instead of the expected {'Position': {'Position x [mm]': 3}}

Maybe there is already a solution for the problem, but I did not find it in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant