(Quick Reference)

grep

目的
Purpose

Uses the Groovy JDK grep method to iterate over each element of the specified object that match the specified "filter" attribute. The filter can be different instances such as classes, regex patterns etc.

使用例
Examples

Stephen King's non-fiction Books:
<g:grep in="${books}" filter="NonFictionBooks.class">
     <p>Title: ${it.title}</p>
</g:grep>

<g:grep in="${books.title}" filter="~/.*Groovy.*/"> <p>Title: ${it}</p> </g:grep>

詳細
Description

属性

Attributes
  • in - The object to iterative over
  • filter - The filter instance such as a class, regular expression or anything that implements isCase