Strip block comments: Difference between revisions

PascalABC.NET
(Easylang)
(PascalABC.NET)
 
(One intermediate revision by one other user not shown)
Line 1,935:
function something() {
}</pre>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
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.
</syntaxhighlight>
{{out}}
<pre>
 
function subroutine() {
a = b + c ;
}
function something() {
}
</pre>
 
 
=={{header|Perl}}==
Line 3,151 ⟶ 3,189:
=={{header|Wren}}==
{{trans|Go}}
<syntaxhighlight lang="ecmascriptwren">var stripper = Fn.new { |start, end|
if (start == "" || end == "") {
start = "/*"
230

edits