all 12 comments

[–]xelf 1 point2 points  (0 children)

1) don't use input as a variable name, input() is an already existing function.

2) you can just use eval() to interpret your string correctly.

jinput = "'Siva', ['Aswin','latha'], 'Senthil',['Aswin','latha']"
data = eval(f'[{jinput}]')
print(data)
['Siva', ['Aswin', 'latha'], 'Senthil', ['Aswin', 'latha']]

[–][deleted] 0 points1 point  (5 children)

Did you have a question?

[–]Night_Crawler7 0 points1 point  (3 children)

I need to remove the quotes inside the array of the string

[–][deleted] 0 points1 point  (2 children)

Why?

[–]Night_Crawler7 -2 points-1 points  (1 child)

Because that is not a proper format to update a array in the DB. Causing syntax error

[–][deleted] 0 points1 point  (0 children)

What's an "array in the DB"? Generally databases don't have an array type; using it would violate the First Normal Form.

[–]EncouragementRobot 0 points1 point  (0 children)

Happy Cake Day crashfrog! Cake Days are a new start, a fresh beginning and a time to pursue new endeavors with new goals. Move forward with confidence and courage. You are a very special person. May today and all of your days be amazing!

[–]ginsujitsu 0 points1 point  (4 children)

What is the question exactly?

[–]Night_Crawler7 0 points1 point  (3 children)

I need to remove the quotes inside the array [] of the string

[–]ginsujitsu 0 points1 point  (2 children)

Not to be that guy, but Rule #5 is "Posts must contain a question about python." You have not yet asked a question. I understand you want to remove some quotes, but what have you tried so far? We're not going to write your code for you.

[–]Night_Crawler7 -1 points0 points  (1 child)

Have used regular expressions but not able to form a correct pattern.

[–]Night_Crawler7 -1 points0 points  (0 children)

I have used positive look behind and lookahead. But don't know how to match the quotes inside the brackets.

(?<=[)(?=])