Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!uccba!spca6!icc!wdm From: wdm@icc.com (Bill Mulert) Newsgroups: comp.unix.questions Subject: Regular Expression tool Message-ID: <1990Jun8.174056.15313@icc.com> Date: 8 Jun 90 17:40:56 GMT Organization: Intercomputer Communications Corp., Cincinnati, OH Lines: 30 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@icc.com marguaritas, & drivin' trucks. |Intercomputer Communications Corp. I'm going back to Beethoven, |Cincinnati, Ohio 45236 'cause country music sucks. |513-745-0500