0

How to extract the string that occurs between the first single quote and then extract the string that occurs between the second single quote separately in a pandas dataframe. I have tried (\'(.*)\'), but it extracts all strings between quotes regardless of the appearance. Example:

This is 'Test1' and this is 'Test2'

I want first to extract Test1 and then extract Test2 separately.

sam_alloy
  • 65
  • 4
  • `re.findall(r".*?'(.*?)'.*?'(.*?)'","This is 'Test1' and this is 'Test2'")` if you want them in pairs – markalex Apr 14 '23 at 13:43

0 Answers0