regex for C comments

Steven McCanne mccanne at cory.Berkeley.EDU
Wed Jul 12 17:33:00 AEST 1989


In article <502 at chem.ucsd.EDU> tps at chem.ucsd.edu (Tom Stockfisch) writes:
>So, who has the shortest single LEX expression that correctly
>matches C comments --
>Mine is
>	"/*"\/*([^/]|{[^*/]\/+})*"*/"

How about:

	"/*"([^*]|\*+[^/*])*\*+\/

Steve



More information about the Comp.lang.c mailing list