Anonymous user
Strip block comments: Difference between revisions
Added Groovy version
(→{{header|MATLAB}} / {{header|Octave}}: strip block comments) |
(Added Groovy version) |
||
Line 470:
}`))
}</lang>
=={{header|Groovy}}==
<lang groovy>def code = """
/**
* Some comments
* longer comments here that we can parse.
*
* Rahoo
*/
function subroutine() {
a = /* inline comment */ b + c ;
}
/*/ <-- tricky comments */
/**
* Another comment.
*/
function something() {
}
"""
println ((code =~ "(?:/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/)|(?://.*)").replaceAll(''))</lang>
=={{header|Haskell}}==
|