genzou #7195(2008/08/18 11:35 GMT) [ Groovy ] Rating0/0=0.00
実行結果は以下のようになりました。
>>> removeComment('AAA') 'AAA' >>> removeComment('AAA/*BBB*/') 'AAA' >>> removeComment('AAA/*BBB') 'AAA' >>> removeComment('AAA/*BBB*/CCC') 'AAACCC' >>> removeComment('AAA/*BBB/*CCC*/DDD*/EEE') 'AAADDD*/EEE' >>> removeComment('AAA/a//*BB*B**/CCC') 'AAA/a/CCC'
1 2 3
def removeComment( text ){ println text.replaceAll(/(\/\*.*?\*\/)|(\/\*.*$)/, "") }
Rating0/0=0.00-0+
[ reply ]
genzou
#7195()
[
Groovy
]
Rating0/0=0.00
実行結果は以下のようになりました。
>>> removeComment('AAA') 'AAA' >>> removeComment('AAA/*BBB*/') 'AAA' >>> removeComment('AAA/*BBB') 'AAA' >>> removeComment('AAA/*BBB*/CCC') 'AAACCC' >>> removeComment('AAA/*BBB/*CCC*/DDD*/EEE') 'AAADDD*/EEE' >>> removeComment('AAA/a//*BB*B**/CCC') 'AAA/a/CCC'def removeComment( text ){ println text.replaceAll(/(\/\*.*?\*\/)|(\/\*.*$)/, "") }Rating0/0=0.00-0+
[ reply ]