c_comments.in revision 272343
1272343Sngie# Let's have some fun -- try to match a C comment. 2272343Sngie# first the obvious, which looks okay at first glance... 3272343Sngie/\*.*\*/ - /*x*/ /*x*/ 4272343Sngie# but... 5272343Sngie/\*.*\*/ - /*x*/y/*z*/ /*x*/y/*z*/ 6272343Sngie# okay, we must not match */ inside; try to do that... 7272343Sngie/\*([^*]|\*[^/])*\*/ - /*x*/ /*x*/ 8272343Sngie/\*([^*]|\*[^/])*\*/ - /*x*/y/*z*/ /*x*/ 9272343Sngie# but... 10272343Sngie/\*([^*]|\*[^/])*\*/ - /*x**/y/*z*/ /*x**/y/*z*/ 11272343Sngie# and a still fancier version, which does it right (I think)... 12272343Sngie/\*([^*]|\*+[^*/])*\*+/ - /*x*/ /*x*/ 13272343Sngie/\*([^*]|\*+[^*/])*\*+/ - /*x*/y/*z*/ /*x*/ 14272343Sngie/\*([^*]|\*+[^*/])*\*+/ - /*x**/y/*z*/ /*x**/ 15272343Sngie/\*([^*]|\*+[^*/])*\*+/ - /*x****/y/*z*/ /*x****/ 16272343Sngie/\*([^*]|\*+[^*/])*\*+/ - /*x**x*/y/*z*/ /*x**x*/ 17272343Sngie/\*([^*]|\*+[^*/])*\*+/ - /*x***x/y/*z*/ /*x***x/y/*z*/ 18