A Perl expression. You could use this for sed-like activities:
# Print included files.
ack --output '$1' '#include <(.*)>'
You could presumably do much trickier things as well, since the --output argument can contain any Perl expression.