> From: Leonid Leibman <http://www.raqia.com/~leonidl> > Date: Tue, 04 Sep 2001 09:12:06 -0400 > > ---Executing: html-to-ascii > Hi, Robert -- first of all (if you're still interested in the subject) I > learnt that the algorithm for conversion of > a regular expression directly to DFA (without the intermediate NFA) is > much more efficient than the > classical Thompson algorithm I (we) used. Somehow the need of e-closure > for empty transitions is > eliminated from the picture by some trick. All this is in the next > section of the Dragon book. Seems like > the commercial products use this algorithm as well. That's good to know. > Second -- a question -- how can one use backreferences in awk (in sed > one does s/a\(b*\)a\1/.....). > Can I do something of this sort in awk? For example can I accomplish > something like > > /a\(b*\)a\1/ { print \1} > > or maybe something simpler like > > /a\(b*\)a/ {print \1} > > More generally, is there some mechanism like this in awk?-- I don't know of any way. Can't sed be used? If I had to do this, I'd probably just use Perl. > Leonid Leibman