Check if string matches pattern Check if string matches pattern python python