小编sta*_*t64的帖子

使用Sed和Regex替换字符串

我正在尝试使用sed但使用正则表达式取消注释文件内容(例如:[0-9] {1,5})

# one two 12
# three four 34
# five six 56
Run Code Online (Sandbox Code Playgroud)

以下是有效的:

sed -e 's/# one two 12/one two 12/g' /file
Run Code Online (Sandbox Code Playgroud)

但是,我想要的是使用正则表达式模式替换所有匹配而不输入数字但保留结果中的数字.

regex string bash replace sed

20
推荐指数
2
解决办法
7万
查看次数

重命名Grails域类中的显示字段名称

鉴于以下Grails域类,如何将isbn的显示字段名称重命名为"ISBN"(而不是默认的"Isbn"),并将作者重命名为"Author(s)"(与默认值相对) "作者")?

class Book {
    String name
    String isbn
    static hasMany = [ authors: Author ]
}

class Author {
    String name
}
Run Code Online (Sandbox Code Playgroud)

grails grails-domain-class

6
推荐指数
1
解决办法
3298
查看次数

可搜索的插件无法解决Grails中的类2.2.4

每当我第一次运行我的Grails应用程序时,使用可搜索的0.6.4,我收到以下错误:

| Error Fatal error during compilation org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 25: unable to resolve class org.compass.gps.device.hibernate.HibernateGpsDevice
 @ line 25, column 1.
   import org.compass.gps.device.hibernate.HibernateGpsDevice
   ^

C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 26: unable to resolve class org.compass.gps.impl.SingleCompassGps
 @ line 26, column 1.
   import org.compass.gps.impl.SingleCompassGps
   ^

2 errors
 (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 25: unable to resolve class org.compass.gps.device.hibernate.HibernateGpsDevice
 @ line 25, column 1.
   import org.compass.gps.device.hibernate.HibernateGpsDevice
   ^

C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 26: unable to resolve class org.compass.gps.impl.SingleCompassGps
 @ …
Run Code Online (Sandbox Code Playgroud)

grails searchable grails-searchable

4
推荐指数
2
解决办法
3635
查看次数