Do something if STDIN matches a pattern