Reading patterns from standard input