RosettaCodeData/Task/Strip-block-comments/PascalABC.NET/strip-block-comments.pas

22 lines
348 B
ObjectPascal

begin
var s := '''
/**
* Some comments
* longer comments here that we can parse.
*
* Rahoo
*/
function subroutine() {
a = /* inline comment */ b + c ;
}
/*/ <-- tricky comments */
/**
* Another comment.
*/
function something() {
}
''';
Regex.Replace(s,'/\*(\n|\r|\r\n|.)*?\*/','').Print
end.