Strip block comments: Difference between revisions
m
Added the Sidef language
(Nimrod -> Nim) |
m (Added the Sidef language) |
||
Line 1,680:
}
</pre>
=={{header|Sidef}}==
For extra credit, it allows the caller to redefine the delimiters.
<lang ruby>func strip_block_comments(code, beg='/*', end='*/') {
var re = Regex.new(beg.escape + '.*?' + end.escape, 's');
code.gsub(re, '');
}
say strip_block_comments(ARGF.slurp);</lang>
=={{header|Tcl}}==
|