Extract text between two square brackets in python.
Example string: Get[How]Stuff
Expected Output: How
Below is the python script
string="Get[How]Stuff"
#position of opening square bracket
firstpos=string.rfind("[")
#position of closing square bracket
lastpos=string.rfind("]")
#printing the text between two square brackets
print(string[firstpos+1:lastpos])#Prints output 'How'