apply(str, actions) {
    for (var [start, end, tags] of this.match(str)) {
      for (var tag of tags) {
        if (typeof actions[tag] === 'function') {
          actions[tag](start, end, str.slice(start, end + 1));
        }
      }
    }
  }
For each match over the input sequence, action functions matching
the tag definitions in the input pattern are called with the startIndex,
endIndex, and sub-match sequence.