Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!orion.cf.uci.edu!uci-ics!schmidt@zola.ics.uci.edu From: schmidt@zola.ics.uci.edu (Doug Schmidt) Newsgroups: comp.lang.c Subject: regex for C comments Message-ID: <19365@paris.ics.uci.edu> Date: 10 Jul 89 04:11:05 GMT Sender: news@paris.ics.uci.edu Reply-To: schmidt@zola.ics.uci.edu (Doug Schmidt) Distribution: na Organization: University of California, Irvine - Dept of ICS Lines: 20 In their book ``Introduction to Compiler Construction with UNIX,'' Schreiner and Friedman provide the following LEX regular expression for recognizing C comments: ---------------------------------------- "/*""/"*([^*/]|[^*]"/"|"*"[^/])*"*"*"*/" ---------------------------------------- Ignoring the possibility of overflowing an internal LEX buffer, does anyone know of any legal C comments that fail to match with this regular expression? thanks, Doug -- Master Swordsman speak of humility; | schmidt@ics.uci.edu (ARPA) Philosophers speak of truth; | office: (714) 856-4034 Saints and wisemen speak of the Tao of no doubt; The moon, sun, and sea speaks for itself. -- Hiroshi Hamada