sql – RegEx with spaces and delimiters

I have a two columns with the following data:

Column 1: BIG123 – Telecommunications (John Barrot)

Column 2: 7 Congressional 1 – Toward

The data format is the same with spaces and the “-” as the delimiter for each column, but the organization, names, and beginning code can be longer or shorter than what you see here(instead of Telecommunications it can be CEO or instead of John Barrott it can be Guy Rodriguez, etc). I need to extract the following:

(Column names are in bold)

Organization Telecommunications

Supervisor John Barrot

Congressional 1 – Toward

I have been using the following cheat sheet but I am still having issues extracting: cheatography.com/davechild/cheat-sheets/regular-expressions/

I have tried regex_extract(column1, [A-Z][a-z]) and I only get the first two letters of column 1 after the “-“.

Any help would be great.



Read more here: Source link