# Groovy Filter

**URL:** https://community.ofelia.com/t/groovy-filter/25984
**Category:** Contributions
**Tags:** actor-filter
**Created:** [23 October 2013 14:01 UTC](https://community.ofelia.com/t/groovy-filter/25984 "2013-10-23T14:01:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)
#### Post date: [23 October 2013 14:01 UTC](https://community.ofelia.com/t/groovy-filter/25984/1 "2013-10-23T14:01:25Z")

</div>

## This filter let you use a groovy script to filter your actors. It takes in input a set of String bind in the variable candidates, and must return a set of String. Here is a simple example :

def result =   
candidates.each {  
if(it ==~ /Romain.\*/)  
result.add(it)  
}

## result as Set

This example parse the candidates in input and return a Set of String matching the regex (name beginning by Romain)

KNOWN LIMITATION : Your script must not use the groovy markers ‘${’ and ‘}’ (set by the editor)  
  
**Repository URL :** [http://community.ofelia.com/project/groovy-filter](http://community.ofelia.com/project/groovy-filter)
