Answer
[tuple(s[s.find("-") + 1:].split("_")) for s in strings]
Explanation
Each string has a nice regular format:
- a description
- employee number
- id number
- 'sc' number (don't know what that could be)
These attributes are all separated by an underscore: _.
You're result doesn't need to description, so find the place of the end of the description and remove it. I find the first hyphen (-) then only keep everything after that.
Then I split the remaing string into three strings, using split("_").
This returns the three parts you want, which I then put into a tuple.
I perform this for each string in strings.
You can put it in a function like this:
def extract_tags(strings):
result = [tuple(s[s.find("-") + 1:].split("_")) for s in strings]
return result
Here is the output on your test string:
[('emp-001', 'id-01', 'sc-01'),
('emp-002', 'id-02', 'sc-12'),
('emp-003', 'id-03', 'sc-10')]