Pattern AST
  
           | optional file
          P|     { \S+ name }[ ]{ \d+ count }
           | end
  
MatchOptional    (name: file)
    MatchValue    (name: name, scalar)
        MatchRegex '\\S+'
    MatchRegex '[ ]'
    MatchValue    (name: count, scalar)
        MatchRegex '\\d+'
Input String Captured JSON
foo.py 3
{
  "file": {
    "count": "3", 
    "name": "foo.py"
  }
}

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