File: README

package info (click to toggle)
txt2regex 0.8-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, squeeze
  • size: 264 kB
  • ctags: 65
  • sloc: sh: 1,569; makefile: 119
file content (202 lines) | stat: -rw-r--r-- 5,593 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
txt2regex README file


  Program    : txt2regex
  Summary    : A Regular Expression Wizard, written with bash2 builtins
  Author     : Aurelio Marinho Jargas (verde@aurelio.net)
  License    : GPL
  Homepage   : http://txt2regex.sf.net
  
  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.


----------------------------------------------------------------------


  INSTALL AND RUN
  ===============

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.

- Just english: untar and run
- With i18n: untar, make install and run

untar

  tar xvzf txt2regex-VERSION.tgz
  cd txt2regex-VERSION


run

  ./txt2regex.sh


make install (as root, system install)

  make install
  /usr/bin/txt2regex


make install (as user, local install)

  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.

----------------------------------------------------------------------


  TESTED PROGRAMS VERSIONS
  ========================

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:

- From the program documentation
- Or missing it, from the "Mastering Regular Expressions" O'Reilly book
- Or missing it, from Internet documents (Oh no!)

Programs that were tested here:

- ed: GNU ed version 0.2
- mawk: mawk 1.3.3 Nov 1996
- gawk: GNU Awk 3.0.6
- grep: grep (GNU grep) 2.4.2
- egrep: egrep (GNU grep) 2.4.2
- find: GNU find version 4.1
- javascript: netscape-4.77
- mysql: Ver 11.13 Distrib 3.23.36
- ooo: OpenOffice.org 1.1.0
- perl: v5.6.0 built for i386-linux
- php: 4.0.6
- postgres: psql (PostgreSQL) 7.1.2
- procmail: procmail v3.15.1 2001/01/08
- python: Python 2.1
- sed: GNU sed version 3.02.80
- tcl: 8.3
- vi: Nvi 1.79 (10/23/96)
- vim: VIM - Vi IMproved 5.8 (2001 May 31)

----------------------------------------------------------------------


  TRANSLATIONS MAINTAINERS
  ========================

"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.

----------------------------------------------------------------------


  FAQ
  ===

- Q: Why?
- A: To try to make simple regexes less painful for the beginners
- A: To have a reliable source for regexes differences between programs
- A: To have coding fun &:)

- Q: Why bash2?
- A: Basically, for me to learn the new bash2 concepts as arrays, i18n
  and advanced variable expansion. They rule!

- Q: My screen has more than 25 lines, I'm serious!
- Q: Why it only uses 80 columns if my screen has more?
- Q: I've changed the xterm window size, why it didn't notice that?
- A: The program do use the bash environment variables $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


- Q: Why my bash version is not recognized correctly?
- Q: Here bash --version is >=2.04. Why the program gets other?
- A: To find your bash version, the program uses the $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.

- Q: What is that <TAB> that appears when I choose TAB on the
  special combination menu?
- A: Inside lists [], the <TAB> string is a visual representation of
     a literal TAB character, for programs wich doesn't support [\t].

----------------------------------------------------------------------

The End.