Added pattern parameter.