I have a column in a pandas data frame called sample_id. Each entry contains a string, from this string I'd like to pull a numeric pattern that will have one of two forms
1-234-5-6789
or
123-4-5648
I'm having trouble defining the correct regex pattern for this. So far I have been experimenting with the following:
re.findall(pattern=r'\b2\w+', string=str(data['sample_id']))
But this is only pulling values that are starting with 2 and only the first chunk of the numeric pattern. How do I express the above patterns with the dashes?