Regular Expression tool

Bill Mulert wdm at icc.com
Sat Jun 9 03:40:56 AEST 1990


Consider the following statements containing regular expressions:

echo "`expr \"$1\" : \"^[^=]*=\(.*\)\"`"

df_usr=`df | sed -n '/^\/usr[   ]/s/[^)]*):[    ]*\([^  ]*\).*/\1/p'`

sed	-e 's/\([!:]\)\([0-9]\)/\1 \2/' \
	-e '/!/s/^\([^ 	][^ 	]*\).*[,-][,-]*\([0-9][0-9]*\)$/\1 1-\2/' \
	< .newsrc.old > .newsrc

sed 's/^\([^:! 	]*\).*$/\1/' $ACTIVE | sort > $TMPFILE.1

Do you have a headache, now? I do. I find any but the simplist regular
expressions to be "write only". They are rather like C's declarations
that so often cause even veteran programmers to look askance.
Fortunately, we have cdecl to help create and decode the C declarations.

I wish there were something similar for regular expressions. I would
like to have a tool, call it regex, that would allow me to say:

regex ' "^[^=]*=\(.*\)\" '
and have regex say, in plain language, what the expression means.

Is there anything like that in existance? Any ideas on how large
a project like that might be?
-- 
I'm tired of hearin' songs about cheatin',|Bill Mulert   wdm at icc.com
     marguaritas, & drivin' trucks.       |Intercomputer Communications Corp.
      I'm going back to Beethoven,        |Cincinnati, Ohio  45236
      'cause country music sucks.         |513-745-0500



More information about the Comp.unix.questions mailing list