     @outPorts =
       out: new noflo.Port
 
+    @inPorts.pattern.on "connect", =>
+      @patterns = []
+
     @inPorts.pattern.on "data", (pattern) =>
-      @pattern = _.map pattern, (p) -> new RegExp(p) if _.isArray(pattern)
+      @patterns.push new RegExp pattern
 
     @inPorts.replacement.on "connect", =>
       @cache.connect()

      @outPorts.out.disconnect()

  matchPattern: ->
    groups = @groups.slice(0, @pattern.length)

    for p, i in @pattern
      return false unless groups[i]?.match(p)?

    return true


  constructor: ->
    @cache = new CacheStorage
    @patterns = []

    @inPorts =
      in: new noflo.Port
