Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!wasatch!helios.ee.lbl.gov!pasteur!cory.Berkeley.EDU!mccanne From: mccanne@cory.Berkeley.EDU (Steven McCanne) Newsgroups: comp.lang.c Subject: Re: regex for C comments Message-ID: <15391@pasteur.Berkeley.EDU> Date: 12 Jul 89 07:33:00 GMT References: <19365@paris.ics.uci.edu> <502@chem.ucsd.EDU> Sender: news@pasteur.Berkeley.EDU Reply-To: mccanne@cory.Berkeley.EDU.UUCP (Steven McCanne) Distribution: na Organization: University of California, Berkeley Lines: 11 In article <502@chem.ucsd.EDU> tps@chem.ucsd.edu (Tom Stockfisch) writes: >So, who has the shortest single LEX expression that correctly >matches C comments -- >Mine is > "/*"\/*([^/]|{[^*/]\/+})*"*/" How about: "/*"([^*]|\*+[^/*])*\*+\/ Steve