I have a colum named data, which have string values in different formats like:
55,'first_name','2394234'
'first_name', '2394234'
'124', 'first_name', '2394234'
I need to extract substring first_name. I'm really bad at SQL, but in python the regex that would extract the first name would be like this:
\'(?P<first_name>[a-zA-Z]{4,})\',\s*\'[0-9]{7}\'
The pattern I need is any combination of letters enclosed in ' ' followed by , after that could be spaces and finally enclosed in ' ' again a number of length 7.
Please any clues would be great.