CSDNRGY 2017-01-03 05:26 采纳率: 88%
浏览 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 【Hadoop 问题】Hadoop编译所遇问题hadoop-common: make failed with error code 2
  • ¥15 vb6.0+webbrowser无法加载某个网页求解
  • ¥15 RPA财务机器人采购付款流程
  • ¥15 计算机图形多边形及三次样条曲线绘制
  • ¥15 根据protues画的图用keil写程序
  • ¥200 如何使用postGis实现最短领规划?
  • ¥15 pyinstaller打包错误
  • ¥20 cesm的气溶胶排放文件
  • ¥15 逐月累计,月份不连续,补齐月份
  • ¥15 应用简单的Python代码完成一个学生成绩管理系统