All apps/grex

grex

grex

Generates regular expressions from user-provided test cases.

Runs as grex|macOS, Linux, Windows|github.com

Command form

ai-draft · 2 tasks · 15 fields

Build a regular expression from example strings or a file of test cases.

Opens the form; the finished command lands at your prompt, unrun
otty gui grex
Generate regexExample values, fixed in this page — nothing here reaches a terminal
Basic
Test cases*
string
Digits to \d
--digits
Detect repetitions
--repetitions
TasksEach one presets the form for one job
From examples
inputsdigitsrepetitions
From a file
filedigitswordsrepetitions
ParametersOnly these flags are editable in the form
Test cases
Example strings the regex must match.
string · positional 0 · repeatable
Read test cases from file
One test case per line.
path
--file-f
Digits to \d
boolean
--digits-d
Whitespace to \s
boolean
--spaces-s
Word characters to \w
boolean
--words-w
Detect repetitions
Convert repeated substrings to {min,max} notation.
boolean
--repetitions-r
Ignore case
boolean
--ignore-case-i
Capturing groups
boolean
--capture-groups-g
Escape non-ASCII
boolean
--escape-e
Non-digits to \D
boolean
--non-digits-D
Non-whitespace to \S
boolean
--non-spaces-S
Non-word to \W
boolean
--non-words-W
Syntax highlighting
boolean
--colorize-c
Minimum repetitions
Needs --repetitions.
string
--min-repetitions
Minimum substring length
Needs --repetitions.
string
--min-substring-length
SourcesEvery flag above is checked against these
fig
completion

github.com

Before it fills your prompt, Otty checks the installed grex against its version. A form that does not match your version is not offered.