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 } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/grex.ts" license = "MIT" [[commands.field]] id = "inputs" label = "Test cases" description = "Example strings the regex must match." type = "string" position = 0 multiple = true sources = ["fig"] [[commands.field]] 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"] [[commands.field]] id = "digits" label = "Digits to \\d" type = "boolean" option = ["--digits", "-d"] sources = ["fig"] [[commands.field]] id = "spaces" label = "Whitespace to \\s" type = "boolean" option = ["--spaces", "-s"] sources = ["fig"] [[commands.field]] id = "words" label = "Word characters to \\w" type = "boolean" option = ["--words", "-w"] sources = ["fig"] [[commands.field]] id = "repetitions" label = "Detect repetitions" description = "Convert repeated substrings to {min,max} notation." type = "boolean" option = ["--repetitions", "-r"] sources = ["fig"] [[commands.field]] id = "ignore_case" label = "Ignore case" type = "boolean" option = ["--ignore-case", "-i"] sources = ["fig"] [[commands.field]] id = "capture_groups" label = "Capturing groups" type = "boolean" option = ["--capture-groups", "-g"] sources = ["fig"] [[commands.field]] id = "escape" label = "Escape non-ASCII" type = "boolean" option = ["--escape", "-e"] sources = ["fig"] [[commands.field]] id = "non_digits" label = "Non-digits to \\D" type = "boolean" option = ["--non-digits", "-D"] sources = ["fig"] [[commands.field]] id = "non_spaces" label = "Non-whitespace to \\S" type = "boolean" option = ["--non-spaces", "-S"] sources = ["fig"] [[commands.field]] id = "non_words" label = "Non-word to \\W" type = "boolean" option = ["--non-words", "-W"] sources = ["fig"] [[commands.field]] id = "colorize" label = "Syntax highlighting" type = "boolean" option = ["--colorize", "-c"] sources = ["fig"] [[commands.field]] id = "min_repetitions" label = "Minimum repetitions" description = "Needs --repetitions." type = "string" option = ["--min-repetitions"] sources = ["fig"] [[commands.field]] id = "min_substring_length" label = "Minimum substring length" description = "Needs --repetitions." type = "string" option = ["--min-substring-length"] sources = ["fig"] [[commands.task]] id = "examples" label = "From examples" fields = ["inputs", "digits", "repetitions"] required = ["inputs"] [[commands.task]] id = "file" label = "From a file" fields = ["file", "digits", "words", "repetitions"] required = ["file"] [[commands.group]] id = "basic" label = "Basic" fields = ["inputs", "file", "digits", "spaces", "words", "repetitions", "ignore_case"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["capture_groups", "escape", "non_digits", "non_spaces", "non_words", "colorize", "min_repetitions", "min_substring_length"]