Pattern AST
          P| Change[ ]{ \d+ change-num }\s*
           | repeated * files
          P|     ...[ ]{ [^#]+ filename }#{ \d+ revision }[ ]{ \w+ action }\s*
           | end
  
MatchRegex 'Change[ ]'
MatchValue    (name: change-num, scalar)
    MatchRegex '\\d+'
MatchRegex '\\s*'
MatchRepeated    (name: files)
    MatchRegex '...[ ]'
    MatchValue    (name: filename, scalar)
        MatchRegex '[^#]+'
    MatchLiteral '#'
    MatchValue    (name: revision, scalar)
        MatchRegex '\\d+'
    MatchRegex '[ ]'
    MatchValue    (name: action, scalar)
        MatchRegex '\\w+'
    MatchRegex '\\s*'
Input String Captured JSON
Change 35
... foo.py#13 add
{
  "files": [
    {
      "action": "add", 
      "revision": "13", 
      "filename": "foo.py"
    }
  ], 
  "change-num": "35"
}

This HTML fragment was automatically generated from the test cases for JSON Pattern.