Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Unable to search keys containing '-' character : solution #50

@IntelliDust

Description

@IntelliDust

For example:

$result = (new JSONPath($data))->find('$..neighbor[?(@.neighbor-id == "192.168.1.1")]');

ends with:
PHP Fatal error: Uncaught Exception: Malformed filter query

after I replaced in QueryMatchFilter

@(\.(?<key>\w+)|\[["\']?(?<keySquare>.*?)["\']?\])
by
@(\.(?<key>\S+)|\[["\']?(?<keySquare>.*?)["\']?\])

Working like charm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions