Xref: utzoo comp.unix.questions:30586 comp.unix.wizards:25030 comp.unix.internals:2584 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!news.cs.indiana.edu!arizona.edu!arizona!optima.UUCP From: ric@optima.UUCP (Ric Anderson) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.internals Subject: Re: Would somebody please explain? Message-ID: <2225@optima.cs.arizona.edu> Date: 21 Apr 91 04:09:27 GMT References: <1991Apr21.023416.5795@mp.cs.niu.edu> Sender: news@cs.arizona.edu Followup-To: comp.unix.questions Lines: 34 From article <1991Apr21.023416.5795@mp.cs.niu.edu>, by rickert@mp.cs.niu.edu (Neil Rickert): > In article <1991Apr21.001702.5661@umbc3.umbc.edu> rouben@math16.math.umbc.edu (Rouben Rostamian) writes: [stuff deleted] >>coincide. Now, would somebody please explain why the command: >> expr "match" : "ma" >>complains of a "syntax error"? > > I just ran: strings /bin/expr > > From the output I would guess that 'match', 'index', 'substr' and 'length' > are builin functions or operators for 'expr', although they are not documented > in any man pages that I have seen. According to the man page on my system, the syntax of these functions is : string : re match string re look in string for the regular expression "re". returns the number of characters matched, or the string matched if \(...\) is used. substr string integer-1 integer-2 return the substring of "string" starting at integer-1, of length integer-2 characters. 1 = first character, and a length greater than whats left, returns whats left. index string list return the position of the first character in "string" that occurs in "list" length string return the length of "string". Ric (ric@cs.arizona.edu )