Yanghn Notes

          BlogJava 首頁 新隨筆 聯(lián)系 聚合 管理
            10 Posts :: 10 Stories :: 2 Comments :: 0 Trackbacks

          由于工作需要,要求去掉java類中的注釋,寫了兩個個正則表達式

          去掉/**/(eclipse)----------------/\*(.|[\r\n])*?\*/
          去掉//(eclipse)------------------ //.*$
          去掉import(eclipse)------------ import.*$

          去掉空行(ue) ------%[ ^t]++^p

          第一個正則表達式參考這個

          http://ostermiller.org/findcomment.html

          http://hi.baidu.com/cowskin/blog/item/c8760546937d95036a63e54e.html

          Finding Comments in Source Code Using Regular Expressions

          posted on 2010-05-10 09:54 小海 閱讀(515) 評論(0)  編輯  收藏 所屬分類: java
          主站蜘蛛池模板: 中宁县| 乌恰县| 商河县| 蓬莱市| 莱州市| 贵阳市| 金门县| 珠海市| 房产| 卢氏县| 石柱| 上林县| 区。| 绥德县| 房产| 瓦房店市| 崇明县| 武夷山市| 内江市| 玉山县| 启东市| 手游| 桃园市| 玛纳斯县| 镇康县| 广饶县| 邯郸市| 施秉县| 通江县| 河北省| 会理县| 辽阳县| 靖西县| 石景山区| 师宗县| 且末县| 漠河县| 舞钢市| 靖西县| 铜梁县| 康定县|