[oak perl] more regular.expressions

B.E.G. oaklandpm at eli.users.panix.com
Thu Feb 12 18:58:57 CST 2004


Jon Seidel wrote:
> I really enjoyed Elijah's presentation yesterday -- well organized and
> exampled. I was intrigued by the reference to RE's being around in
> mathematics before unix commandeered them so I looked around the web

Really old programmer text editors have them as well. Example: TECO,
which still exists today. Source for TECO clones exists at least. And
TECO has basic regexps, but the syntax is a bit different from the
current form.  (This is partially because everything in TECO is different
from how modern software works.) Trivia: Emacs started as a macro set
for TECO; it is a highly programmable editor.

> briefly. I found these two tidbits;
> 1) The document www2.cs.utep.edu/~cs3350/CS3350Lecture2.ppt is part of a
> CompSci course, and discusses RE's in mathematics. Since I'm not a math or
> CS major, it's a little dense, but interesting nonetheless.

You might find more results if you use the word "automata" along with
other terms in your searches. Here's a page I found searching for
"finite automata":

http://www.ics.uci.edu/~eppstein/161/960222.html

_MRE_ first ed has a bit of automata background, second ed probably
does, too.

> 2) One of the unix dictionaries gives the following definition:
>     GREP Global Regular Expression Print
> which I hadn't seen before.

That comes from ed (and ex) where "g" starts a "global" (operate on
every line) command, if then followed by a /regexp/ and a "p" it would
print the lines that matched the regexp. (But you can also copy the
the line, move the lines, delete the lines, etc.)

I'm sure any Unix you have access to has "ed" installed, try it out.

$ ed /etc/passwd
2533
g/root/p
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
q
$

Elijah
------
ed will be installed because, pre-perl, it was used script editing files 



More information about the Oakland mailing list