May 21, 2020


txt2regex -- console regular expression wizard


txt2regex [--nocolor|--whitebg] [--all|--prog programs]

txt2regex --showmeta

txt2regex --showinfo program [--nocolor]

txt2regex --history value [--all|--prog programs]

txt2regex --make label [--all|--prog programs]


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.



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 txt2regex can 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.

Do not use colors.

--prog <program1,program2,...>
Specify which programs to use, separated by commas. Use --showmeta to see the complete list of available programs.

--showinfo <program>
Print regex-related info about the specified program. Use --nocolor to have a text-only output (no control characters).

Print a metacharacters table featuring all the programs.

-V, --version
Print the program version and quit.

Adjust colors for white background terminals.


Using it as a wizard (interactive interface):


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


| Top menu                              |
| Group menu                            |
|                                       |
| Regexes of the selected programs      |
| ...                                   |
| ...                                   |
|                                       |
| History                               |
| Prompt                                |
|                                       |
| The question                          |
| The answers                           |
| ...                                   |
| ...                                   |


. Quit the program (with confirmation)
0 Reset the regular expression
1-9 Answers the questions
* Toggles color ON/OFF
/ Add/remove programs
| Insert an alternation (where allowed)
( Open a new group (where allowed)
) Close the opened group (if any)




Aurelio Jargas <<verde (a) aurelio net>>


Copyright © 2001-2020 Aurelio Jargas, GNU GPL v2