CSDNRGY 2017-01-03 05:26 采纳率: 87%
浏览 1025
已采纳

求大神帮忙写个正则表达式

我想替换掉Eclipse面实体类的注解,如何用正则表达式,匹配如下内容

替换掉

/** 开头

*/ 结尾

例如:

     /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column GC_SECCHECK_EVERYDAY_FILE_LOG.ID
     *
     * @mbggenerated Tue Jan 03 13:19:09 CST 2017
     */

我需要一个正则匹配这些垃圾注解,然后我就可以把他们替换掉了

完成实体类,如何才能用正则匹配注释

 public class TempType{
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column GC_TEMP_TYPE.TEMP_TYPE_ID
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    private String tempTypeId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column GC_TEMP_TYPE.TEMP_TYPE_NAME
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    private String tempTypeName;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column GC_TEMP_TYPE.IS_DEL
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    private String isDel;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column GC_TEMP_TYPE.CREATE_TIME
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    private String createTime;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column GC_TEMP_TYPE.TEMP_TYPE_ID
     *
     * @return the value of GC_TEMP_TYPE.TEMP_TYPE_ID
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    public String getTempTypeId() {
        return tempTypeId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column GC_TEMP_TYPE.TEMP_TYPE_ID
     *
     * @param tempTypeId the value for GC_TEMP_TYPE.TEMP_TYPE_ID
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    public void setTempTypeId(String tempTypeId) {
        this.tempTypeId = tempTypeId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column GC_TEMP_TYPE.TEMP_TYPE_NAME
     *
     * @return the value of GC_TEMP_TYPE.TEMP_TYPE_NAME
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    public String getTempTypeName() {
        return tempTypeName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column GC_TEMP_TYPE.TEMP_TYPE_NAME
     *
     * @param tempTypeName the value for GC_TEMP_TYPE.TEMP_TYPE_NAME
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    public void setTempTypeName(String tempTypeName) {
        this.tempTypeName = tempTypeName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column GC_TEMP_TYPE.IS_DEL
     *
     * @return the value of GC_TEMP_TYPE.IS_DEL
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    public String getIsDel() {
        return isDel;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column GC_TEMP_TYPE.IS_DEL
     *
     * @param isDel the value for GC_TEMP_TYPE.IS_DEL
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column GC_TEMP_TYPE.CREATE_TIME
     *
     * @return the value of GC_TEMP_TYPE.CREATE_TIME
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    public String getCreateTime() {
        return createTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column GC_TEMP_TYPE.CREATE_TIME
     *
     * @param createTime the value for GC_TEMP_TYPE.CREATE_TIME
     *
     * @mbggenerated Fri Dec 23 09:45:15 CST 2016
     */
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
  • 写回答

3条回答 默认 最新

  • CSDNRGY 2017-01-10 00:48
    关注

    自己写出来了

    在eclipse下使用这个即可匹配无效的垃圾注释

     (.*)\*(.*)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 怎样采集全国最新个体工商户数据
  • ¥20 我是一名大学生,想学习java是自学还是报培训班呢
  • ¥15 pycharm该如何爬取网易云歌曲下的评论?
  • ¥15 java调用sap webservice问题
  • ¥20 如何完全复现何恺明resnet论文里的结果,有代码吗,获得论文中的结果(如下图)
  • ¥15 mysql如果表行行数小于1000条还需要分区吗
  • ¥20 有关matlab自定义特殊算符的问题
  • ¥15 第15届蓝桥杯选拔赛斗鱼养殖场
  • ¥15 在vivado的FIFO使用中,FIFO有没有提供可以输出内部存储空间状态的端口?
  • ¥15 C++ QT内存数据匹配对比指导