1*57718be8SEnji Cooper# Let's have some fun -- try to match a C comment. 2*57718be8SEnji Cooper# first the obvious, which looks okay at first glance... 3*57718be8SEnji Cooper/\*.*\*/ - /*x*/ /*x*/ 4*57718be8SEnji Cooper# but... 5*57718be8SEnji Cooper/\*.*\*/ - /*x*/y/*z*/ /*x*/y/*z*/ 6*57718be8SEnji Cooper# okay, we must not match */ inside; try to do that... 7*57718be8SEnji Cooper/\*([^*]|\*[^/])*\*/ - /*x*/ /*x*/ 8*57718be8SEnji Cooper/\*([^*]|\*[^/])*\*/ - /*x*/y/*z*/ /*x*/ 9*57718be8SEnji Cooper# but... 10*57718be8SEnji Cooper/\*([^*]|\*[^/])*\*/ - /*x**/y/*z*/ /*x**/y/*z*/ 11*57718be8SEnji Cooper# and a still fancier version, which does it right (I think)... 12*57718be8SEnji Cooper/\*([^*]|\*+[^*/])*\*+/ - /*x*/ /*x*/ 13*57718be8SEnji Cooper/\*([^*]|\*+[^*/])*\*+/ - /*x*/y/*z*/ /*x*/ 14*57718be8SEnji Cooper/\*([^*]|\*+[^*/])*\*+/ - /*x**/y/*z*/ /*x**/ 15*57718be8SEnji Cooper/\*([^*]|\*+[^*/])*\*+/ - /*x****/y/*z*/ /*x****/ 16*57718be8SEnji Cooper/\*([^*]|\*+[^*/])*\*+/ - /*x**x*/y/*z*/ /*x**x*/ 17*57718be8SEnji Cooper/\*([^*]|\*+[^*/])*\*+/ - /*x***x/y/*z*/ /*x***x/y/*z*/ 18