See previous question, How to pipe on a condition in Bash. I'm interested in the same construct for Fish, i.e. shorthand for:
set check 0if test $check = 1 printf "foo\nbar\nbaz\n" | string match --regex ^felse printf "foo\nbar\nbaz\n" | string match --regex ^bend