create_pattern function

Create a pattern to match date