Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!linus!linus!sdimax2!jrv From: jrv@sdimax2.mitre.org (VanZandt) Newsgroups: comp.lang.c Subject: Re: Looking for pattern matchers Keywords: pattern, regex Message-ID: <1991Mar1.125146.25894@linus.mitre.org> Date: 1 Mar 91 12:51:46 GMT References: <1156@nikhefh.nikhef.nl> Sender: news@linus.mitre.org (News Service) Organization: The MITRE Corp., Bedford MA Lines: 15 Nntp-Posting-Host: sdimax2.mitre.org In article <1156@nikhefh.nikhef.nl> a38@nikhefh.nikhef.nl (James Barr) writes: >can anyone point me towards a regular expression matcher >that acts like lex in that you can add a number of different >expressions so that a token is returned on matching a >particular expression. Henry Spencer's regular expression routine initializes an array of pointers corresponding to the open parentheses in the regular expression. How about consolidating the REs into one big RE and determining which subexpressions matched by testing which pointers are set: (able)|(baker)|(charlie) Note: I haven't tried this. - Jim Van Zandt