bla*_*hli 0 regex printing groovy text
我在文本文件中搜索了包含该单词的所有行velcro.我现在想要打印这些行的内容,但只打印后面的部分velcro
velcro
说我有一行文字
the purple monkey climbs the velcro cactus
我将如何打印之后的所有内容velcro(寻找一般答案)
我开始时:
c = /.*velcro.*/ if (line ==~ c){ println ... }
ata*_*lor 5
在正则表达式中使用捕获组:
c = ~/.*velcro(.*)/ m = line =~ c if (m) { println m[0][1] }
归档时间:
13 年,11 月 前
查看次数:
82 次
最近记录: