Table of Contents

Class JsonPathMatching

Namespace
MRX.Json.Path
Assembly
MRX.Json.dll

Provides compiled regular expressions used to tokenize JSON paths.

public static class JsonPathMatching
Inheritance
JsonPathMatching
Inherited Members

Methods

JsonPathKeys()

[GeneratedRegex("\\w+", RegexOptions.None, 1000)]
public static Regex JsonPathKeys()

Returns

Regex

Remarks

Pattern:

\\w+

Explanation:
○ Match a word character atomically at least once.

JsonPathTokens()

[GeneratedRegex("(?<property>\\w+)|\\[(?:(?<quote>[\"'])(?<str_idx>.+)\\k<quote>|(?<num_idx>\\d+))\\]", RegexOptions.None, 1000)]
public static Regex JsonPathTokens()

Returns

Regex

Remarks

Pattern:

(?<property>\\w+)|\\[(?:(?<quote>["'])(?<str_idx>.+)\\k<quote>|(?<num_idx>\\d+))\\]

Explanation:
○ Match with 2 alternative expressions, atomically.
    ○ "property" capture group.
        ○ Match a word character atomically at least once.
    ○ Match a sequence of expressions.
        ○ Match '['.
        ○ Match with 2 alternative expressions.
            ○ Match a sequence of expressions.
                ○ "quote" capture group.
                    ○ Match a character in the set ["'].
                ○ "str_idx" capture group.
                    ○ Match a character other than '\n' greedily at least once.
                ○ Match the same text as matched by the "quote" capture group.
            ○ "num_idx" capture group.
                ○ Match a Unicode digit atomically at least once.
        ○ Match ']'.