Replace nodes with pattern-matching selectors in aster.