Comment recognition in Lex, again

David Canzi rjhurdal at watmath.UUCP
Sat May 5 07:58:05 AEST 1984


The puzzles in net.unix-wizards are better than the ones in net.puzzle.
I blew two hours composing this:
	"/*"[^*]*"*"+([^*/][^*]*"*"+)*"/" printf("<<<%s>>>", yytext) ;
and tested it on this input:
	asdqwa/*/asaas*/werwer
	sdf/**/sdfsdf/***/erwerwer
	cvb/*tdfg*/*xcvcv*/werwe
	ty/bcvb/*******/***/fssdf
and it appears to work.  Please let me know if you come up with cases
where it doesn't work...



More information about the Comp.unix.wizards mailing list