Python Detect Pattern In String Requires