setEdgeTypeFilter(expr) {

    expr = expr.replace(/[\n\r]/g, ' ');

    if (this.getEdgeTypeFilter('raw') === expr) { // already up to date
      // This check is critical to prevent recursion!
      return;
    }

    utils.setField(this.edgeTypeFilterTRef, 'filter', expr);

    $tm.logger('debug', 'Edge filter set to', expr);

  }
Sets and rebuilds the edge type filter according to the expression provided.

@param {string} expr - A tiddlywiki filter expression.