Adding pattern to input