# Write a Python Program to Convert String Matrix Representation to Matrix import re  # initializing stringtest_str = "[gfg,is],[best,for],[all,geeks]"  # printing original stringprint("The original string is : " + str(test_str))  flat_1 = re.findall(r"\[(.+?)\]", test_str)res = [sub.split(",") for sub in flat_1]  # printing resultprint("The type of result : " + str(type(res)))print("Converted Matrix : " + str(res))