w3resource
Python Exercises

Python: Extract values between quotation marks of a string

Python Regular Expression: Exercise-38 with Solution

Write a Python program to extract values between quotation marks of a string.

Sample Solution:-

Python Code:

import re
text1 = '"Python", "PHP", "Java"'
print(re.findall(r'"(.*?)"', text1))

Sample Output:

['Python', 'PHP', 'Java']

Flowchart:

Flowchart: Regular Expression - Extract values between quotation marks of a string.

Visualize Python code execution:

The following tool visualize what the computer is doing step-by-step as it executes the said program:

Python Code Editor:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a python program to convert snake case string to camel case string.
Next: Write a Python program to remove multiple spaces in a string.

What is the difficulty level of this exercise?