Regular Expression String Matching Geeksforgeeks Python