The trusty int subpattern -- which uses the int filter.
Pattern int AST
  P|   { \d+ | int }
MatchValue    (anonymous, filter: int, scalar)
    MatchRegex '\\d+'
Input String Captured JSON
43
43
Captures a date in this format.
Pattern Y/M/D AST
  P|   {:int year} / {:int month} / {:int day}
MatchSubpattern int
MatchLiteral '/'
MatchSubpattern int
MatchLiteral '/'
MatchSubpattern int
Input String Captured JSON
2009/07/04
{
  "month": 7, 
  "day": 4, 
  "year": 2009
}
Captures a time in this format.
Pattern H:M:S AST
  P|    {:int hour} : {:int minute} : {:int second}
MatchSubpattern int
MatchLiteral ':'
MatchSubpattern int
MatchLiteral ':'
MatchSubpattern int
Input String Captured JSON
09:55:59
{
  "second": 59, 
  "minute": 55, 
  "hour": 9
}
One or more word characters, separated by commas. Both the repeated block and its values are anonymous here.
Pattern comma-list AST
  
    |    repeated +
   P|       { [\w\-]+ } ,?
    |    end
  
MatchRepeated    (anonymous)
    MatchValue    (anonymous, scalar)
        MatchRegex '[\\w\\-]+'
    MatchRegex ',?'
Input String Captured JSON
andy,bob,foo-eng
[
  "andy", 
  "bob", 
  "foo-eng"
]
A pattern for a full change description.

Notice that we use the comma-list subpattern twice, the Y-M-D, H:M:S subpatterns, and the int subpattern many times.

Features used: an optional block with scalar ($) capture, and the bool filter.

Scalar capture means that we want the text matched within the block, rather than the captured values. This is like the difference between group 0 and group 1 in Python, and Java, and & and $1 in Perl.

The bool filter converts an arbitrary JSON value to true or false, according to Python's rules.

Pattern p4-desc AST
  
    #     Line one
   SP|    Change {:int change-num} by { \w+ username }@{ \w+ client } on {#}
   SP|    {:Y/M/D date} {:H:M:S time}
     |    $optional pending | bool
   SL|        {#} *pending*
     |    end
  
    #     Now the change description
    P|    \n\n
    P|    { .* desc }  {# TODO: .* isn't right, need a special construct}
    P|    \n
  
    #     Metadata block
    P|    \s* R={:comma-list reviewers}
    P|    \s* CC={:comma-list cc}
    P|    \s* 
     |    value delta
   SL|        DELTA={:int total}  {# 2 spaces}
   SL|        ({:int added} added, {:int deleted} deleted, {:int changed} changed)
     |    end
    P|    \n
    P|    \s* OCL={:int ocl}
    P|    \s*
  
    #     List of affected files
    P|    Affected files ...\n  {# TODO: This could be a "}
    P|    \n
     |    repeated files
   SL|        ... {#}
   SP|        { [^#]+ filename }#{:int revision} { \w+ action }\n
     |    end
MatchLiteral 'Change '
MatchSubpattern int
MatchLiteral ' by '
MatchValue    (name: username, scalar)
    MatchRegex '\\w+'
MatchLiteral '@'
MatchValue    (name: client, scalar)
    MatchRegex '\\w+'
MatchLiteral ' on '
MatchSubpattern Y/M/D
MatchLiteral ' '
MatchSubpattern H:M:S
MatchOptional    (name: pending, filter: bool, scalar)
    MatchLiteral ' *pending*'
MatchRegex '\\n\\n'
MatchValue    (name: desc, scalar)
    MatchRegex '.*'
MatchRegex '\\n'
MatchRegex '\\s* R='
MatchSubpattern comma-list
MatchRegex '\\s* CC='
MatchSubpattern comma-list
MatchRegex '\\s*'
MatchValue    (name: delta)
    MatchLiteral 'DELTA='
    MatchSubpattern int
    MatchLiteral '  '
    MatchLiteral '('
    MatchSubpattern int
    MatchLiteral ' added, '
    MatchSubpattern int
    MatchLiteral ' deleted, '
    MatchSubpattern int
    MatchLiteral ' changed)'
MatchRegex '\\n'
MatchRegex '\\s* OCL='
MatchSubpattern int
MatchRegex '\\s*'
MatchRegex 'Affected files ...\\n'
MatchRegex '\\n'
MatchRepeated    (name: files)
    MatchLiteral '... '
    MatchValue    (name: filename, scalar)
        MatchRegex '[^#]+'
    MatchLiteral '#'
    MatchSubpattern int
    MatchLiteral ' '
    MatchValue    (name: action, scalar)
        MatchRegex '\\w+'
    MatchRegex '\\n'
Input String Captured JSON
Change 9616701 by someone@chubot on 2009/01/06 13:22:34 *pending*

        Add support for Firefox 3.1

        R=bob
        CC=dan,eric
        DELTA=125  (93 added, 0 deleted, 32 changed)
        OCL=9616701

Affected files ...

... //depot/opensource/gears/base/common/js_runner_ff.cc#33 edit
... //depot/opensource/gears/base/common/js_standalone_engine_mozjs.cc#6 edit
... //depot/opensource/gears/base/firefox/install.rdf.m4#3 edit
{
  "username": "someone", 
  "files": [
    {
      "action": "edit", 
      "revision": 33, 
      "filename": "//depot/opensource/gears/base/common/js_runner_ff.cc"
    }, 
    {
      "action": "edit", 
      "revision": 6, 
      "filename": "//depot/opensource/gears/base/common/js_standalone_engine_mozjs.cc"
    }, 
    {
      "action": "edit", 
      "revision": 3, 
      "filename": "//depot/opensource/gears/base/firefox/install.rdf.m4"
    }
  ], 
  "change-num": 9616701, 
  "cc": [
    "dan", 
    "eric"
  ], 
  "reviewers": [
    "bob"
  ], 
  "delta": {
    "deleted": 0, 
    "total": 125, 
    "added": 93, 
    "changed": 32
  }, 
  "client": "chubot", 
  "time": {
    "second": 34, 
    "minute": 22, 
    "hour": 13
  }, 
  "date": {
    "month": 1, 
    "day": 6, 
    "year": 2009
  }, 
  "ocl": 9616701, 
  "pending": true, 
  "desc": "        Add support for Firefox 3.1"
}

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