I need an expression which checks if there is any content written inside braces ("braces" could be any of ()
, {}
, []
). For Example it should give True
to these strings:
"I am sharad my phone number is (0000000)"
"hi this [sharad]"
"{there} you go"
"[this is error]"
And should give False
to:
"ho ho ho"
"here comes santa []"
"{} what is this"
If there is any content inside braces, return True
, else False
. I am new to Python thanks for your help in advance.
For example:
df = pd.read_excel(file)
df.index = range(2,df.shape[0]+2)
for index,row in df.iterrows():
if(row['column_name']******) # expression to check if there is any
# content inside brackets content could be
# nan, string or a number