Quantcast
Channel: Data Preparation & Blending discussions
Viewing all articles
Browse latest Browse all 4999

Regex to subset a string between " - "

$
0
0

So, I have the following data in a single column:

10-Junior-32

101-Senior-23

102-Senior Pres-34

01-Senior Pres XYZ-30

 

and this is the desired output:

Junior

Senior

Senior Pres

Senior Pres XYZ

 

I am trying to subset the string between the "-".

Since neither the position is set or the number of characters to take out.

I can only think of regex which could subset the string between "-" and put it into a new column. That is the desired output.

 

Any thoughts or suggestions would be highly appreciated. Thanks!!!


Viewing all articles
Browse latest Browse all 4999

Trending Articles