{
  "id": "grex",
  "name": "grex",
  "description": "Generates regular expressions from user-provided test cases.",
  "homepage": "https://github.com/pemistahl/grex",
  "executables": [
    "grex"
  ],
  "commands": {
    "format": 1,
    "label": "Generate regex",
    "description": "Build a regular expression from example strings or a file of test cases.",
    "quality": "ai-draft",
    "base": "fig:grex",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": false,
      "short_attached": true,
      "short_bundles": true
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/grex.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "inputs",
        "label": "Test cases",
        "description": "Example strings the regex must match.",
        "type": "string",
        "position": 0,
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "file",
        "label": "Read test cases from file",
        "description": "One test case per line.",
        "type": "path",
        "option": [
          "--file",
          "-f"
        ],
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "digits",
        "label": "Digits to \\d",
        "type": "boolean",
        "option": [
          "--digits",
          "-d"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "spaces",
        "label": "Whitespace to \\s",
        "type": "boolean",
        "option": [
          "--spaces",
          "-s"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "words",
        "label": "Word characters to \\w",
        "type": "boolean",
        "option": [
          "--words",
          "-w"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "repetitions",
        "label": "Detect repetitions",
        "description": "Convert repeated substrings to {min,max} notation.",
        "type": "boolean",
        "option": [
          "--repetitions",
          "-r"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "ignore_case",
        "label": "Ignore case",
        "type": "boolean",
        "option": [
          "--ignore-case",
          "-i"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "capture_groups",
        "label": "Capturing groups",
        "type": "boolean",
        "option": [
          "--capture-groups",
          "-g"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "escape",
        "label": "Escape non-ASCII",
        "type": "boolean",
        "option": [
          "--escape",
          "-e"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "non_digits",
        "label": "Non-digits to \\D",
        "type": "boolean",
        "option": [
          "--non-digits",
          "-D"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "non_spaces",
        "label": "Non-whitespace to \\S",
        "type": "boolean",
        "option": [
          "--non-spaces",
          "-S"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "non_words",
        "label": "Non-word to \\W",
        "type": "boolean",
        "option": [
          "--non-words",
          "-W"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "colorize",
        "label": "Syntax highlighting",
        "type": "boolean",
        "option": [
          "--colorize",
          "-c"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "min_repetitions",
        "label": "Minimum repetitions",
        "description": "Needs --repetitions.",
        "type": "string",
        "option": [
          "--min-repetitions"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "min_substring_length",
        "label": "Minimum substring length",
        "description": "Needs --repetitions.",
        "type": "string",
        "option": [
          "--min-substring-length"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "examples",
        "label": "From examples",
        "fields": [
          "inputs",
          "digits",
          "repetitions"
        ],
        "required": [
          "inputs"
        ]
      },
      {
        "id": "file",
        "label": "From a file",
        "fields": [
          "file",
          "digits",
          "words",
          "repetitions"
        ],
        "required": [
          "file"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "inputs",
          "file",
          "digits",
          "spaces",
          "words",
          "repetitions",
          "ignore_case"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "capture_groups",
          "escape",
          "non_digits",
          "non_spaces",
          "non_words",
          "colorize",
          "min_repetitions",
          "min_substring_length"
        ]
      }
    ]
  }
}
