I've incrementally updated a regular expression to cleanup a data and found it runs infinity long for the string. It's a Python code to test.
import re
re.sub(r'(([-.]?\d+)|(\d+))+$', '', 'bcn16-01081-210300-16-20160829-ca')
I suppose it's because of duplicates of \d+ in groups because it became working if reg exp is simplified to ([-.]\d+|\d+)+$. But I want to know more precise. Anybody knows?