txt2regex - a Regular Expression Wizard, written with bash2 builtins
txt2regex --all|--prog <p1,p2,...,pN>
txt2regex --showmeta|--showinfo <program>
txt2regex --make <target>
txt2regex --history <value>
txt2regex is a Regular Expression "wizard", all written with bash2 builtins, that converts human sentences to regexes.
With a simple interactive interface, you just answer to questions and build your own regex for a large variety of programs, like awk, emacs, grep, perl, php, procmail, python, sed and vim. There are more than 20 supported programs.
It's bash so download and run, no compilation needed.
Please visit the program homepage at https://aurelio.net/projects/txt2regex/.
By default, all options are turned OFF. Just call it with no options to launch the default interactive interface.
--all is cool but requires lots of lines (~35)
--nocolor is strong, so it kills --whitebg
--showmeta rules, try it
--showinfo uses reverse video output, --nocolor turns it off
--history is getting useful, stay tunned
--make is a remedy for headaches
--prog is nice to use your favorite programs, mix it with --make and --history
$ xterm -fg black -bg white ; txt2regex --whitebg
$ txt2regex --showmeta
$ txt2regex --showinfo sed
$ txt2regex --prog vim,sed,grep,python
$ txt2regex --history '16421¤:01¤:'
$ txt2regex --make hour $ txt2regex --make number3 --prog perl $ txt2regex --make date2 --all
The program interface is simple and easy to use. This is its contents:
+---------------------------------------+ | -> Top menu | | -> Group menu | | | | -> Regexes of the programs selected | | ... | | ... | | | | -> History | | -> Your prompt | | | | -> The question | | -> The answers | | ... | | ... | +---------------------------------------+
All the basic commands can be used on the numeric pad on the keyboard, but remember to turn ON the NumLock key.
|.||Quit the program (with confirmation)|
|0||Reset the Regular Expression|
|1-9||Answers the questions|
|*||Toggles color ON/OFF|
|/||Add/remove programs on/from the list|
||||Insert an alternation (where allowed)|
|(||Open a new group (where allowed)|
|)||Close the opened group (if any)|
Bug reports and contributions are VERY welcome! Please send them to the author.
Written and maintained by Aurelio Marinho Jargas <<verde (a) aurelio net>>
Copyright © 2000, 2001, 2002, 2003, 2004 Aurelio Marinho Jargas
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.