1

I'm trying to extract some text from a column on a CSV file. Here is an example:

"Lorem ipsum dolor sit amet (2015), consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua (2000)."

I wanna get a new column with "amet (2015)" and "aliqua (2000)". This expression gives me the (2015) and (2000): value.find(/(.*?)/)

But how can I also get the word before the parentheses?

Tom Morris
  • 10,490
  • 32
  • 53

1 Answers1

0

here is the regex your are looking for /\w* \([^\)]*\)/gm.

Taimoor Qureshi
  • 620
  • 4
  • 14