commands.sh

grex

all

Generate `regex`s.

More info →

Options (7)

-i, --ignore-caseboolean

Generate a case-insensitive `regex`

Example: grex {{[-i|--ignore-case]}} {{string1 string2 ...}}
-d, --digitsboolean

Replace digits with `\d`

Example: grex {{[-d|--digits]}} {{string1 string2 ...}}
-w, --wordsboolean

Replace Unicode word character with `\w`

Example: grex {{[-w|--words]}} {{string1 string2 ...}}
-s, --spacesboolean

Replace spaces with `\s`

Example: grex {{[-s|--spaces]}} {{string1 string2 ...}}
-r, --repetitionsboolean

Detect repeating patterns in the input and shorten them using {min,max} quantifiers

Example: grex {{[-r|--repetitions]}} {{string1 string2 ...}}
-f, --fileboolean

Generate `regex` of test cases (separated by newline) from a file

Example: grex {{[-f|--file]}} {{path/to/file}}
-g, --capture-groupsboolean

Do not generate anchors and non-capture groups

Example: grex --no-anchors {{[-g|--capture-groups]}} {{string1 string2 ...}}

Examples (8)

Generate a simple `regex`

grex string1 string2 ...

Generate a case-insensitive `regex`

grex [-i|--ignore-case] string1 string2 ...

Replace digits with `\d`

grex [-d|--digits] string1 string2 ...

Replace Unicode word character with `\w`

grex [-w|--words] string1 string2 ...

Replace spaces with `\s`

grex [-s|--spaces] string1 string2 ...

Detect repeating patterns in the input and shorten them using {min,max} quantifiers

grex [-r|--repetitions] string1 string2 ...

Generate `regex` of test cases (separated by newline) from a file

grex [-f|--file] path/to/file

Do not generate anchors and non-capture groups

grex --no-anchors [-g|--capture-groups] string1 string2 ...
made by @shridhargupta | data from tldr-pages