Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!agate!ucbvax!ucdavis!uop!greg From: greg@uop.EDU (Greg Onufer) Newsgroups: comp.lang.c Subject: Re: regex for C comments (Found a loophole?) Message-ID: <392@uop.uop.EDU> Date: 11 Jul 89 23:00:55 GMT References: <19365@paris.ics.uci.edu> <4626@omepd.UUCP> <6396@columbia.edu> Distribution: na Organization: University of the Pacific, Stockton, CA Lines: 18 kearns@read.columbia.edu (Steve Kearns) writes: >A previous article claimed that >>| ---------------------------------------- >>| "/*""/"*([^*/]|[^*]"/"|"*"[^/])*"*"*"*/" >>| ---------------------------------------- I believe that "/*""/"*([^*/]|[^*]"/"|"/*"|"*"[^/])*"*"*"*/" +++++ will work better. Try "/* * /* */" with the previous regex... I could not claim to know whether or not it is a legal comment, but the previous regex DOES pass "/* /* */". Cheers!greg