Jump to content

Strip block comments: Difference between revisions

Added Groovy version
(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}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.