Program : txt2regex Summary : A Regular Expression Wizard, written with bash2 builtins Author : Aurelio Marinho Jargas (verde@aurelio.net) License : GPL Homepage : http://aurelio.net/txt2regex/ Description: ^txt2regex$ is a Regular Expression "wizard", all written with bash2 builtins, that converts human sentences to regexes. With a simple 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.
Txt2regex will work in ANY system bash works, because it's a bash-only program. This includes Cygwin and Cygwin XFree also.
After expand the tarball, do you can simply run the program directly.
But if do you want it on your system, or in other language besides
english, use the make command.
tar xvzf txt2regex-VERSION.tgz cd txt2regex-VERSION
./txt2regex.sh
make install /usr/bin/txt2regex
make install BINDIR=. LOCALEDIR=po ./txt2regex
Note 1: Play with BINDIR, LOCALEDIR and DESTDIR variables to change the defalt install paths.
Note 2: Txt2regex only works in Bash version >= 2.04.
All regexes and rules the program knows about were extensively tested by hand or by the test-suite program. When the program can't be reached or executed on my machine, the rules were taken:
Programs that were tested here:
"I feel like I could... Like I could... TAKE OVER THE WORLD"
de_DE german Jan Parthey en english the author es_ES spanish Diego Moya id_ID bahasa indonesian Muhamad Faizal it_IT italian Daniele Pizzolli ja japanese Hajime Dei pl_PL polish Chris Piechowicz pt_BR brazilian portuguese the author ro_RO romanian Robert Claudiu Gheorghe
A nice way to contribute with the project, is to translate its
messages to your own language. Just get the po/txt2regex.pot
file and translate it, on the "msgstr" lines. In doubt, ask.
$LINES and
$COLUMNS to get the actual screen size. Those MUST be exported
variables, or you'll be stucked at the default 80x25 size. Try:
/bin/bash -c 'echo $COLUMNS $LINES'
If you don't get the screen size, do:
echo export COLUMNS LINES >> ~/.bash_profile
$BASH_VERSION
environment variable that is available in all bash versions.
If some alien has possessed your machine and your environment
don't have this variable, try to set it by hand. Check with
echo $BASH_VERSION
If this variable is ok, but bash --version returns other
version, check if your bash is really /bin/bash:
which bash
If it's not /bin/bash, you MUST change the first line
of the script to your bash's right path. Suppose you have the
bash binary in your $HOME because the system's bash is old,
just change the first line of the program to:
#!/home/YOU/bin/bash
Or if you cannot change the program file, call it with bash:
bash ./txt2regex
Sux, but worx.
The End.