txt2regex1
Usage
txt2regex [{--nocolor | --whitebg}]
[{--all | --prog
programs}]
txt2regex --showmeta
txt2regex --showinfo
program
[--nocolor]
txt2regex --history
value
[{--all | --prog
programs}]
txt2regex --make
label
[{--all | --prog
programs}]
Overview
txt2regex is a regular expression wizard that converts human sentences to regexes.
In a simple interactive console interface, the user answer questions and txt2regex builds the regexes for more than 20 programs.
https://aurelio.net/projects/txt2regex/
Options
-
--all -
Select all the available programs. Be aware that the list of available programs is long. You will need a terminal window with more than 40 lines for the user interface to fit. Also make sure that the $LINES shell variable is exported, so
txt2regexcan detect the current number of available lines.
-
-h, --help -
Print the help message and quit.
-
--history <value> -
Print a regex from the given history data. The history value is shown in the last screen of the wizard, when you quit.
-
--make <label> -
Print a ready regex for the specified label. Inform an empty label to see the list of available labels.
-
--nocolor -
Do not use colors.
-
--prog <program1,program2,...> -
Specify which programs to use, separated by commas. Use
--showmetato see the complete list of available programs.
-
--showinfo <program> -
Print regex-related info about the specified program. Use
--nocolorto have a text-only output (no control characters).
-
--showmeta -
Print a metacharacters table featuring all the programs.
-
-V, --version -
Print the program version and quit.
-
--whitebg -
Adjust colors for white background terminals.
Examples
- Using it as a wizard (interactive interface):
-
txt2regex
- Specify a custom selection of programs for the wizard:
-
txt2regex --prog perl,python,php,javascript
- Getting an extensive metacharacters table:
-
txt2regex --showmeta
- Getting regex-related information about sed:
-
txt2regex --showinfo sed
- Replay a regex by using history data:
-
txt2regex --history '16421¤:01¤:'
- Getting handy ready-to-use regexes for common patterns:
-
txt2regex --make hour txt2regex --make number3 --prog perl txt2regex --make date2 --all
Wizard interface
+---------------------------------------+ | Top menu | | Group menu | | | | Regexes of the selected programs | | ... | | ... | | | | History | | Prompt | | | | The question | | The answers | | ... | | ... | +---------------------------------------+
Wizard commands
History
- Debian 13 (Trixie) to Debian 11 (Bullseye): the text shown here
- Debian 10 (Buster) to Debian 7 (Wheezy)
- Debian 6.0 (Squeeze) to Debian 3.1 (Sarge)
- Debian 3.0 (Woody)
--all since Debian 3.1 (Sarge);
--help since Debian 3.1 (Sarge);
--history since Debian 3.1 (Sarge);
--make since Debian 3.1 (Sarge);
--nocolor since Debian 3.1 (Sarge);
--prog since Debian 3.1 (Sarge);
--showinfo since Debian 3.1 (Sarge);
--showmeta since Debian 3.1 (Sarge);
--version since Debian 3.1 (Sarge);
--whitebg since Debian 3.1 (Sarge);
-V since Debian 11 (Bullseye);
-h since Debian 11 (Bullseye).