CSDNRGY 2017-01-03 05:26 采纳率: 88.2%
浏览 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 利用决策森林为什么会出现这样·的问题(关键词-情感分析)
  • ¥15 DispatcherServlet.noHandlerFound No mapping found for HTTP request with URI[/untitled30_war_e
  • ¥15 使用deepspeed训练,发现想要训练的参数没有梯度
  • ¥15 寻找一块做为智能割草机的驱动板(标签-stm32|关键词-m3)
  • ¥15 信息管理系统的查找和排序
  • ¥15 基于STM32,电机驱动模块为L298N,四路运放电磁传感器,三轮智能小车电磁组电磁循迹(两个电机,一个万向轮),怎么用读取的电磁传感器信号表示小车所在的位置
  • ¥15 如何解决y_true和y_predict数据类型不匹配的问题(相关搜索:机器学习)
  • ¥15 PB中矩阵文本型数据的总计问题。
  • ¥15 MATLAB卫星二体模型仿真
  • ¥15 怎么让数码管亮的同时让led执行流水灯代码