Closed LongBeachHXC closed 1 year ago
""" use jsonpath_ng.ext """ import jsonpath_ng.ext.filter as jsonpath_filter jsonpath_filter.OPERATOR_MAP.update({'=~': lambda a, b: True if re.search(b, a, re.IGNORECASE) else False}) """ your json path code """
@LongBeachHXC i tested now this and work fine, but if we want to reset after standard behaviours there is a way?
I think it is
jsonpath_filter.OPERATOR_MAP.update({'=~': lambda a, b: True if re.search(b, a, 0) else False})
right?
@dennis-sayed That would indeed be the correct way to restore standard behavior (although you can leave off 0 as the final parameter since it's the default). Closing since this seems to resolved, but feel free to reopen if you're still having an issue.
I have a scenario where I am trying to match on a user's email. The object will look like so:
And I'm trying to match with the following expression:
It does not find the user object.
So, then I tried something like this and it still didn't work:
Is there a way to force the regex for case insensitive?