Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.unix-wizards Subject: Re: awk vs. regular expressions starting with equal sign Message-ID: <4812@utzoo.UUCP> Date: Thu, 20-Dec-84 13:32:47 EST Article-I.D.: utzoo.4812 Posted: Thu Dec 20 13:32:47 1984 Date-Received: Thu, 20-Dec-84 13:32:47 EST References: <4770@utzoo.UUCP>, <1570@pur-phy.UUCP> <4789@utzoo.UUCP>, <435@zeus.UUCP> Organization: U of Toronto Zoology Lines: 28 > 1. It was not clear from your orginal posting that you knew that there > was a work-around... If you re-read my original posting, you'll see explicit mention of using things like /.*=/ as workarounds. Not as nice as /\=/ or /[=]/, but definitely the same sort of animal. > 2. Your quest for a fix implies that there is a problem. That I'm not > so sure about. Both C expression syntax and regular expression > syntax are consistent in isolation from each other, and the conflict > arises only in their concerted application. The ambiguity is a > syntactic one that would require an irregularity in either regular > expressions or arithmetic expressions to resolve it. Better that > they should remain pure, and the conflicts of their mutual > application be documented rather than coming up with yet another > mechanism, one more exception that must be remembered. Sure there's a problem. A perfectly legitimate, valid regular expression won't work. (It does not help that awk gives an extremely cryptic message, and that the problem is not documented anywhere.) There is no fundamental ambiguity here, because the two occur in different contexts. Note that awk does *not* get confused about whether "/" is a division operator or the starting delimiter of a regular expression. It really ought to be doing the same for "/=". Upon close examination of the awk source, I suspect that this is not too hard. I may have a try at a fix; stay tuned. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry